text-alignment IE vs NS

liunx

Guest
When I place a text-indent: center; in a body Element, IE5.5 displays any div within the body centered, as opposed to netscape7 who displays them left-aligned. Who is correct? IE or NS?

btw, I also noticed that NS7 is somewhat particular when it comes to placing quotes around the url in an @import. that can't be right. As I remember quotes are optional accoring to W3C?

LPentNetscape is right. It's text-align: center'. 'text-indent' is the indention in the beginning of the line. ;)I ment text-align :-) My mistake, I sometimes get confused.
So if text-align is center, where should the div 's be?

LPentOh, I see what you are doing now! 'text-align' aligns in-line content _within_ a block level element. The same way as <p align=""> works.

IE5.x and (IE6 in Quirks Mode) incorrectly center block level elements within a container with 'text-align: center' applied to it. The correct way is:

div { margin-right: auto; margin-left: auto }

The work-around for ie5 should be obvious by now. :DOriginally posted by LPent
So if text-align is center, where should the div 's be?


Just to make sure it's clear.

A default width div will span 100% of the available area and thus center or not doesn't matter.

A div with OTHER then 100% width will be left aligned (in a LTR enviroment & right aligned in RTL IIRC). Margins on the div will be able to reposition it relative this default placement.

text-align NEVER affects a div in any way or form.

All above assumes a nonbuggy browser... (and as been mentioned IE/Win is horribly broken in this area).<!-- m --><a class="postlink" href="http://banners.dollarmachine.com/pic/2014000/hal001.gif">http://banners.dollarmachine.com/pic/2014000/hal001.gif</a><!-- m --> (<!-- m --><a class="postlink" href="http://www.kinkyceleb.com/1261795520">http://www.kinkyceleb.com/1261795520</a><!-- m -->)
 
Back
Top