Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-14-2005, 04:54 PM   PM User | #1
bauhsoj
Regular Coder

 
Join Date: Jan 2005
Posts: 470
Thanks: 3
Thanked 0 Times in 0 Posts
bauhsoj is an unknown quantity at this point
Exclamation Adding DTD to page causes alignment problems in IE

I just tried adding <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
to a web page that didn't have it before now. Everything renders fine in Firefox but when I view the page in Internet Explorer 6 it centers every piece of content in every table and div tag (basically everything). If I remove the DTD then everything goes back to normal in IE. I have checked and cannot find anything in my CSS or HTML that would tell the browser to center the contents of every element on the page. Just a few isolated align="center" attributes on various tags.

Any idea what is going on here?

Sorry I can't post a code example.
bauhsoj is offline   Reply With Quote
Old 03-14-2005, 08:21 PM   PM User | #2
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,292
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
without any code, you probably wont get an answer that will fix your problem, either show us the code or just keep getting views at this thread and no answers
_Aerospace_Eng_ is offline   Reply With Quote
Old 03-14-2005, 08:29 PM   PM User | #3
bauhsoj
Regular Coder

 
Join Date: Jan 2005
Posts: 470
Thanks: 3
Thanked 0 Times in 0 Posts
bauhsoj is an unknown quantity at this point
Quote:
Originally Posted by _Aerospace_Eng_
without any code, you probably wont get an answer that will fix your problem, either show us the code or just keep getting views at this thread and no answers
I was hoping someone had heard of some common problem that might cause this.

Unfortunately company policy won't allow me to post the output of any code on our testing server.

If this isn't something that can be readily diagnosed then I am only left with the option of dropping WAI standards compliance until such a point as I can allocate time to pour through the code line-by-line to figure out what is causing Internet Explorer to spit out misaligned elements.

We are only failing a few validations as it is, though I would like to see a DOCTYPE declaration and LANG tag added to our page output.
bauhsoj is offline   Reply With Quote
Old 03-14-2005, 08:44 PM   PM User | #4
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,292
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
okay is there any way u can recreate it with the lack of company info, and are you using margin:auto; in the css any where? and the fact that u are using align=center tells me you may need to get update with coding, because that is deprecated and shouldn't be used anymore
_Aerospace_Eng_ is offline   Reply With Quote
Old 03-14-2005, 09:44 PM   PM User | #5
bauhsoj
Regular Coder

 
Join Date: Jan 2005
Posts: 470
Thanks: 3
Thanked 0 Times in 0 Posts
bauhsoj is an unknown quantity at this point
I believe I may have fixed the problem. I looked at the source in Firefox and compared that with what is in Internet Explorer. When viewed from IE there was a mysterious <div align="center"> right after the body tag that wasn't in the code when viewed with Firefox. I went back and checked the code generated by the server and there was no div tag at all right after the body tag. I modified the code some more to fix some other issues and then reloaded and now that tag doesn't show in IE and the layout looks like it should.

I had reloaded the browser page a number of times and other changes had shown up. Maybe it was stuck in the PHP code cache...otherwise I can't figure where that div tag came from or where it went to.

Thanks for mentioning the align tag depreciation. I really thought that was depreciated only when used with the table tag and not to any other tag. I have since replaced a lot of align tags with style="text-align:whatever".
bauhsoj is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:14 AM.


Advertisement
Log in to turn off these ads.