1

<p style="float: left; position: relative; left: 130px; top: 80px; display: none;" id="homehref"><a href="" style="color: white;">Home Page</a></p>

I have this as my hidden element on the header of my site.

Whenever i mouseover over the header logo i show this element.

In firefox its working fine. But in IE 7 it shifts navigation below it. Can somebody suggest how i can keep my Home Page link truly floating in ie7 as well.

5
  • 1
    please show us the complete code (the header, too) and your css - otherwise it's almost impossible to tell whats wrong. Commented Nov 11, 2010 at 7:43
  • @sushil , is there any reason why you are using "p" instead of a div Commented Nov 11, 2010 at 7:43
  • Can somebody please tell me generally as to how to make a element float on a page. So that there is no effect on element below it. I mean it can move over a layer above. I cant bring the entire code here. Commented Nov 11, 2010 at 7:45
  • no there isnt a reason i have replaced p with a div. But there isnt any effect. Any small hint will be a big help. Commented Nov 11, 2010 at 7:46
  • if you want to float some element over another you can give negative margin like margin-top:-20px; , so that it will come on top of other element , other option will be absolute positioning Commented Nov 11, 2010 at 7:48

4 Answers 4

1

You can do something like this

#divtofloat{
position : absolute
top:10px;
left:10px
}

its stays 10px from left and 10px from top of the page. if you want to come over another element you can give z-index higher than the elements on the page.

With absolute positioning , you can place the div anywhere on the page ...with top,left ,bottom properties.

Sign up to request clarification or add additional context in comments.

Comments

0

The floating works depending on the container-content relationship, so I need to know how html is structured. Anyhow, doesn't seem floating is best solution here. Besides, you have to separate structure (html) from presentation (css). You may need: HTML:

<div id="header">
   <a href="link_to_home">
      <img src="logo_url" />
      <span class="tooltip">Home Page</span>
   </a>
</div>

CSS:

#header a { position: relative;}
#header a span { display: none; position: absolute; left:130px; top: 80px; }
#header a:hover span { display: block;}

How's it working now?

Comments

0

I haven't seen your fully source code but I think you would like to do tooltip on your header logo.If whatever you do here is jquery tooltip would cool style.

Comments

0

@sushi, you could make test page and put it somewhere, then show us :|

Anyway, we're all a little blind here without actual code of situation, but I can assume that maybe you need to put in markup float:left element above over header elements, or use overflow:hidden on it, or somth.

But as @gov already proposed earlier, maybe it's easier to make it absolute positioned. Don't forget to make header element positioned relative in that case.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.