homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

div align, align & valign
Trying to cut down on code

10+ Year Member

Msg#: 1078 posted 12:09 pm on Oct 2, 2001 (gmt 0)

Hi, Often I use a mixture of the above (to be on the safe side!) for text and image alignment within cells, but wondered if its ok to cut down on them and still be safe in all browsers. I thought maybe only right and middle alignment might be the only needed, as browsers might default to top and left. Any tips would be much appreciated. I understand browser support for CSS text-align is not too wide, so this seems the safer bet but results in more code. TIA.



WebmasterWorld Senior Member tedster us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 1078 posted 5:40 pm on Oct 2, 2001 (gmt 0)


I'd say your intuition makes sense -- there's usually no reason to insert the defaults (align="left" or valign="middle") unless you are overriding some previously declared positioning. There's also little reason to declare alignment in the TD tag and then also use a DIV tag for the same purpose.

A <p align="center"> can often take care of alignment changes within a table cell. Extra background color (in a jpg) or transparency (in a gif) can help position an image properly.

As far as CSS support for text-align, the only issues I'm aware of are for "justify" [in NN4 and IE3, both PC and Mac]. Other values are clear sailing.

I personally find code with lots of "insurance" declarations very crazy to maintain, so I using prefer one tag per result. For the same reason, I am learning to avoid layout tables when I use CSS.


10+ Year Member

Msg#: 1078 posted 7:04 pm on Oct 2, 2001 (gmt 0)

Excellent advice, tedster!


10+ Year Member

Msg#: 1078 posted 10:43 am on Oct 3, 2001 (gmt 0)

Thanks very much for your time and great advice Tedster. <p align="centre"> just sorted out a legacy of an NN problem!!

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved