[UPHPU] CSS and IE

Wade Preston Shearer lists at wadeshearer.com
Mon Jun 5 14:09:14 MDT 2006


> Good point Wade.  This should center the page, give it a specific  
> width,
> and position a java-scripted background-image:
>
> body {
>     background-position : 50% 95%;
>     background-repeat : no-repeat;
>     margin-left : auto;
>     margin-right : auto;
>     max-width : 740px;
>   }

MSIE doesn't understand margin: auto. If you want something centered,  
you'll have to use the text-align hack:

body
{
	text-align: center
}

div
{
	width: 500px;
	margin-left : auto;
	margin-right : auto;
}

> However, the outline, obviously inside the <body> tag, get's
> left-aligned.  I tried putting <ul style="margin-left : auto;
> margin-right : auto"> on the outline, but outline remains left-aligned
> in IE.

By "outline," are you referring to your unordered list? Centering a  
list is nearly impossible using browser-supported HTML. Once again,  
to get things to center in MSIE, you need to assign "text-align:  
center" to the element's parent.

> I use this to make room for the background image below the
> outline (instead of through it since it's a background image):
>
>  <ul style="margin-bottom : 500px;">
>
> However, IE does not seem to measure 500px the same as the other
> browsers, and the images overlap with the outline.

You're making it a lot hard than it needs to be. Create a div that is  
below your list, give it a width and height, and then work your  
javascript magic (if you must… have you considered using a "next"  
button to browse the images instead?).

Another thing, why are your validation badges inside of paragraph tags?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2425 bytes
Desc: not available
Url : http://uphpu.org/pipermail/uphpu/attachments/20060605/ee782ad4/smime.bin


More information about the UPHPU mailing list