[thelist] Horizontal element alignment with CSS1

Eöl eol1 at yahoo.com
Fri Nov 9 17:50:05 CST 2001


Paul,

To fix this, you need to go back to the
<satire>good</satire> old days of browser specific
coding.

To replace align="center", this should work <div
style="margin-left: auto; margin-right: auto;"></div>,
needless to say, in m$ enlightened standard compliant
wisdom they fail to implement this.  In IE, you have
to use a <div style="text-align: center;"></div> which
then would center all elements (including block)
within the tag.  Issues with this is a)its wrong
b)NS/Moz will implement this correctly and only center
your non-block elements. 

So the fix that works in both browsers (using <table>
as an example, trying to center on the screen):

<div style="text-align: center;"> #For IE
<table style="margin-left: auto; margin-right: auto;
text-align: left;">#For compliant browsers.  Also this
moves the text(or nonblock elements) within the table
to justify left (otherwise the <div> will make Moz
center the text within the table)
</table>
</div>

Cheers and hope this helps,

Eöl
 
--- Paul Peterson <paul at thereformist.com> wrote:
> Can anybody enlighten me on how to effectively
> replace 'align=center' (in
> DIVs, H1s, TDs, etc.) with a CSS1 control? I've
> scoured all the references I
> have but could only find a 'text-align' property,
> which only seems to apply
> to text within an element rather than the element
> itself. This is confusing
> me, because there is a 'vertical-align' property
> which DOES affect entire
> elements.
> 
> Am I mistaken, or am I still stuck with a deprecated
> attribute to achieve
> what I want?
> 
> Paul (trying to be "Mr. Standards-Compliant")
> Peterson
> 
> 
> 
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt ! 


__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com




More information about the thelist mailing list