Forum Moderators: not2easy

Message Too Old, No Replies

Doc Type & Css Quirk between Firefox & IE

         

ControlZ

5:52 am on Feb 8, 2005 (gmt 0)

10+ Year Member



Having a problem with text the looks fine in Firefox, but aligns center in IE 6.0. I am using <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> as the Doc Type and it validates perfectly.

If I remove the Doc Type, IE shows the text as intended (left justified), but when I add the Doc Type, IE centers ALL the paragraphs of text.

I am guessing it's a combo between CSS and the Doc Type, but just don't know how to modify the HTML or CSS so the text does not align center in IE.

If anyone would like to help, send me a sticky and I'll send you the URL. It's very simple layout and should be esy for someone with more experience then I to fix.

Hester

1:44 pm on Feb 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you using tables? I know when IE6 came out, it centred all my TDs which were in centred TABLEs. I had to manually add left alignment to each cell!

ControlZ

2:32 pm on Feb 8, 2005 (gmt 0)

10+ Year Member



Yes, I am using some tables.

ControlZ

2:40 pm on Feb 8, 2005 (gmt 0)

10+ Year Member



Wierd stuff, but your suggestion worked. Next site, I ditch most, if not all of the tables.

thanks...

jfjet

9:07 pm on Feb 8, 2005 (gmt 0)

10+ Year Member



Just add
td {text-align:left}
in your stylesheet.

ControlZ

12:19 am on Feb 9, 2005 (gmt 0)

10+ Year Member



that's even better ....

Hester

8:51 am on Feb 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yeah I couldn't do that for some reason. Plus I have a mix of cells, some aligned left, some centred. Of course then you just need a class.

There was a definite change with IE6 - it appears that cells now take their alignment from the table. So if your table is centred, your cells will be too. Changed a lot of pages!

ControlZ

4:16 pm on Feb 9, 2005 (gmt 0)

10+ Year Member



Are you designing in Firefox?

Hester

4:38 pm on Feb 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Opera.