lahmayes
02-14-2005, 02:28 PM
This problem is kind of rediculous i'm not sure why i cant find a solution. But anyways, i've got a div with two images in it, and i want them to be centered. heres my code:
<div style="
width: 100%;
position: relative;
margin-left: auto;
margin-right: auto;
padding: 20px;
">
<img src="http://www.alabu.com/ibc/images/photos/projects/cornell-ezranet/cornell-one.jpg" alt="Ezranet Communications Project" />
<img src="http://www.alabu.com/ibc/images/photos/projects/cornell-ezranet/cornell-two.jpg" alt="Ezranet Communications Project" />
</div>
i've tried all kinds of stuff, i cant use an align attribute inside the div instance b/c i'm using XHTML 1.0 strict. how do i center them?
(note: they do center if your screen is small enough, especially in IE, but in mozilla if your resolution is big then they dont center, they stack on top of each other on the right of the page. you can see this at www.alabu.com/ibc/projects/cornell-ezranet.html)
<div style="
width: 100%;
position: relative;
margin-left: auto;
margin-right: auto;
padding: 20px;
">
<img src="http://www.alabu.com/ibc/images/photos/projects/cornell-ezranet/cornell-one.jpg" alt="Ezranet Communications Project" />
<img src="http://www.alabu.com/ibc/images/photos/projects/cornell-ezranet/cornell-two.jpg" alt="Ezranet Communications Project" />
</div>
i've tried all kinds of stuff, i cant use an align attribute inside the div instance b/c i'm using XHTML 1.0 strict. how do i center them?
(note: they do center if your screen is small enough, especially in IE, but in mozilla if your resolution is big then they dont center, they stack on top of each other on the right of the page. you can see this at www.alabu.com/ibc/projects/cornell-ezranet.html)