Jump to content

Absolute Positioning for different browsers


MidnightMermaid

Recommended Posts

I made an image a div layer and I wanted to absolute position it. The code I used was:<IMG STYLE="position:absolute; TOP:322px; LEFT:96px; WIDTH:810px; HEIGHT:510px" SRC="MY IMAGE URL">It looks great in IE, but it's off in Firefox. I used the code validator and it's coming up as right, but what code can I use so it looks the same in both?Thanks,Kristen

Link to comment
Share on other sites

In what way is it "off"? If you want it to line up with something that's NOT absolutely positioned, you should expect trouble.If it's a pixel or two off and the items in question have borders and you're not using a strict DTD, well, that's the old box-model problem.

Link to comment
Share on other sites

Browsers render margins, paddings and spaces somewhat different.I'm with Deirdre's Dad as well: what's "off"? How?If your image is not inside any other container, just plainly put in the HTML right after the <body> tag, then here you go:

body {	margin:0;	padding:0;}

Link to comment
Share on other sites

It's just like I said. Your top image is positioned using the <center> tag, but your bottom image is positioned using absolute coordinates. The chances of them matching consistently are ridiculous. Just changing the size of your window in IE should mess up the alignment. In short: you need to use the same method to position these images.Learning more about the correct way to layout an HTML document is a good idea too.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...