Welcome to WebmasterWorld Guest from 54.196.231.129

Forum Moderators: incrediBILL

Message Too Old, No Replies

div align, align & valign

Trying to cut down on code

     
12:09 pm on Oct 2, 2001 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 3, 2000
posts:142
votes: 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.
5:40 pm on Oct 2, 2001 (gmt 0)

Senior Member

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

joined:May 26, 2000
posts:37301
votes: 0


stuart,

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.

7:04 pm on Oct 2, 2001 (gmt 0)

Junior Member

10+ Year Member

joined:July 20, 2001
posts:137
votes: 0


Excellent advice, tedster!
10:43 am on Oct 3, 2001 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 3, 2000
posts:142
votes: 0


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