buddhi225 Posted May 31, 2009 Share Posted May 31, 2009 Hi, I'm a bit of a CSS newbie so bear with me please. I have a header graphic with navigation links. I want to float some more text links over the top right corner of this image. The image uses an image map so I can't use it as background image. I'm able to place the text where I want in the image, the problem is that it pushes the image down on the page. I want this image to be at the very top of the page and the only way it doesn't move is if I use absolute for the positioning of the text, which I don't want to use. <div id="topnav"> <div id="links"> <p><a href="#">Home </a>¦ <a href="#">Blog</a></p> </div> <img src="http://www.example.com/image.jpg" width="757" height="74" /></div> #topnav { width: 757px; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; } #links { position: relative; top: 20px; left: 0px; width: auto; float: right; } I've experimented with everything I can think of but can't seem to get it how I'd really like it. Thanks for your time. Quote Link to comment Share on other sites More sharing options...
.josh Posted May 31, 2009 Share Posted May 31, 2009 well the only way you are going to get stuff to overlap is by using absolute positioning. Perhaps you don't want to use absolute positioning because you are not using it within the context of the div? Setting the position to relative in #topnav will then make any positioning of things inside it relative to it, instead of the document. So you can then use absolute positioning for #links and it will be relative to to #topnav #topnav { position: relative; width: 757px; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; } #links { position: absolute; top: 20px; right: 0px; width: auto; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.