Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS absolute positioning problem

Status
Not open for further replies.

bunnyweb

MIS
Jan 13, 2003
42
IE
Hi everyone. I'm going bonkers trying to figure out this problem.

I have some simple CSS <DIV> tags on my page to position linked images. I'm using absolute positioning, specifying the left and top pixels. This looks great in IE on my PC, but on my Mac which runs both IE and Safari the images are all over the place.

What am I missing? Any help would be greatly appreciated.

Here is my code snipit:

-------------------------------------------

<BODY MARGINHEIGHT=0 MARGINWIDTH=0 LEFTMARGIN=0 RIGHTMARGIN=0 TOPMARGIN=0 ALIGN=CENTER BGCOLOR="#FFFFFF">

<div style="position: absolute; left: 475px; top: 58px;">
<a href='home.asp'><img src="img/nav/home.gif" border=0></a>
</div>

<div style="position: absolute; left: 399px; top: 65px;">
<a href='contact.asp'><img src="img/nav/contactus.gif" border=0></a>
</div>

-------------------------------------------

 
Is the example code that you posted all the code you have on the website? If so, I see no reason why it should not work, unless you're dealing with bad support of absolute positioning (but then again, I never had any problems on Safari before). Also, what does 'all over the place' mean?
 
Try zeroing the margins and padding of the body and html elements in CSS, and removing all those attributes from the body tag.

This is pure guesswork, but it might be that Safari ignores them, and so less width is available for your images, causing them to be off.

Are you using floats anywhere? Can we see the WHOLE page source, or a URL to it?

Maybe you are not including your CSS correctly. Maybe you have a bad DOCTYPE. Maybe it's any one of a number of other things... we just don't know without seeing other code for contextual information.

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top