HighDots Forums  

Newbie: Placing DOCTYPE tag on HTML file screws up formatting

alt.html alt.html


Discuss Newbie: Placing DOCTYPE tag on HTML file screws up formatting in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
KS
 
Posts: n/a

Default Newbie: Placing DOCTYPE tag on HTML file screws up formatting - 11-09-2004 , 06:20 PM






I have just designed my first website from books I have read and resources
on the net. I designed several pages, but did not put the DOCTYPE tag at
the beginning, figuring I could put the tag in once I got the pages ready.
Everything is formatting and working correct until I put in the DOCTYPE tag,
then the formatting gets screwed up. I must have been mistaken to think the
DOCTYPE tag was useless except for validation purposes. I could probably
put my site on the web without the DOCTYPE tag and it would work fine. Can
anyone tell me why putting the DOCTYPE tag in my HTML file would screw up
the formatting and layout? Does anyone have any recommendations of what to
look for or what changes may need to be made? I'd appreciate the help.

KS



Reply With Quote
  #2  
Old   
Mark Parnell
 
Posts: n/a

Default Re: Newbie: Placing DOCTYPE tag on HTML file screws up formatting - 11-09-2004 , 06:26 PM






On Tue, 9 Nov 2004 15:20:59 -0800, KS <all (AT) tall (DOT) net> declared in
alt.html:

Quote:
Can
anyone tell me why putting the DOCTYPE tag in my HTML file would screw up
the formatting and layout?
http://www.google.com/search?q=doctype+switching

Quote:
Does anyone have any recommendations of what to
look for or what changes may need to be made?
http://validator.w3.org/
http://jigsaw.w3.org/css-validator/

Quote:
I'd appreciate the help.
brucie is in charge of receiving payments.

--
Mark Parnell
http://www.clarkecomputers.com.au
"Never drink rum&coke whilst reading usenet" - rf 2004


Reply With Quote
  #3  
Old   
Michael Winter
 
Posts: n/a

Default Re: Newbie: Placing DOCTYPE tag on HTML file screws up formatting - 11-09-2004 , 06:42 PM



On Tue, 9 Nov 2004 15:20:59 -0800, KS <all (AT) tall (DOT) net> wrote:

Quote:
Can anyone tell me why putting the DOCTYPE tag in my HTML file would
screw up the formatting and layout?
Omitting the DOCTYPE causes more recent browsers to enter into "quirks
mode". Simply put, this emulates the rendering bugs of older browsers when
they didn't conform to standards. These bugs were perpetuated to ensure
that legacy pages weren't broken when they were actually rendered
correctly.

As modern pages should validate[1] and you should aim to use HTML and CSS
as they are specified (rather than hacking solutions), you should force
the browser into "strict mode". One advantage of writing "correct"
documents is that they tend to render more predictably across the wide
range of user agents currently in use.

Quote:
Does anyone have any recommendations of what to look for or what changes
may need to be made?
Googling for "quirks mode" will turn up a lot of information on the
subject, as will just "doctype".

Something else to add is that it's best, in my opinion at least, to test
your pages in browsers better than IE (assuming you don't already). Opera
and Mozilla do a much better job of showing how your pages should actually
look. IE tends to accept any old rubbish.

Mike


[1] See <URL:http://validator.w3.org/> and
<URL:http://jigsaw.w3.org/css-validator/>.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


Reply With Quote
  #4  
Old   
Eric B. Bednarz
 
Posts: n/a

Default Re: Newbie: Placing DOCTYPE tag on HTML file screws up formatting - 11-09-2004 , 07:17 PM



"Michael Winter" <M.Winter (AT) blueyonder (DOT) co.invalid> writes:

Quote:
On Tue, 9 Nov 2004 15:20:59 -0800, KS <all (AT) tall (DOT) net> wrote:

Can anyone tell me why putting the DOCTYPE tag
There is no such thing; the document type declaration is a markup
declaration (even VB programmers should be able to grok that, since it
starts with the MDO ('markup declaration open') delimiter '<!' (!DUH)).

Quote:
in my HTML file would
screw up the formatting and layout?
Because web browser vendors like Microsoft, Mozilla and Opera don't care shit
about standards.

Quote:
As modern pages should validate[1] and you should aim to use HTML and
CSS as they are specified (rather than hacking solutions), you should
force the browser into "strict mode".
You can't *force* IE/windows into "strict mode' (if you need a second
opinion, ask brucie what happens when he configures IE6 to connect
through the proxomitron .

Quote:
One advantage of writing
"correct" documents is that they tend to render more predictably
across the wide range of user agents currently in use.
IE6 has new, additional bugs in so-called 'standards compliant mode',
and Microsoft explicitly states that its results may not be compatible with
future versions of IE and should be avoided altogether for fixed media.

How cool.

Quote:
Googling for "quirks mode" will turn up a lot of information on the
subject, as will just "doctype".
Googling for 'doctype' reveals predominantly BS.


(Mind me, this is hopeless anyway, but needs to be said now and then)


--
Quote:
) Più Cabernet,
-( meno Internet.
) http://bednarz.nl/

Reply With Quote
  #5  
Old   
C A Upsdell
 
Posts: n/a

Default Re: Newbie: Placing DOCTYPE tag on HTML file screws up formatting - 11-09-2004 , 07:34 PM



"KS" <all (AT) tall (DOT) net> wrote

Quote:
I have just designed my first website from books I have read and resources
on the net. I designed several pages, but did not put the DOCTYPE tag at
the beginning, figuring I could put the tag in once I got the pages ready.
Everything is formatting and working correct until I put in the DOCTYPE
tag, then the formatting gets screwed up. I must have been mistaken to
think the DOCTYPE tag was useless except for validation purposes. I could
probably put my site on the web without the DOCTYPE tag and it would work
fine. Can anyone tell me why putting the DOCTYPE tag in my HTML file would
screw up the formatting and layout? Does anyone have any recommendations
of what to look for or what changes may need to be made? I'd appreciate
the help.
See http://www.upsdell.com/BrowserNews/res_doctype.htm





Reply With Quote
  #6  
Old   
C A Upsdell
 
Posts: n/a

Default Re: Newbie: Placing DOCTYPE tag on HTML file screws up formatting - 11-09-2004 , 07:34 PM



"KS" <all (AT) tall (DOT) net> wrote

Quote:
I have just designed my first website from books I have read and resources
on the net. I designed several pages, but did not put the DOCTYPE tag at
the beginning, figuring I could put the tag in once I got the pages ready.
Everything is formatting and working correct until I put in the DOCTYPE
tag, then the formatting gets screwed up. I must have been mistaken to
think the DOCTYPE tag was useless except for validation purposes. I could
probably put my site on the web without the DOCTYPE tag and it would work
fine. Can anyone tell me why putting the DOCTYPE tag in my HTML file would
screw up the formatting and layout? Does anyone have any recommendations
of what to look for or what changes may need to be made? I'd appreciate
the help.
See http://www.upsdell.com/BrowserNews/res_doctype.htm






Reply With Quote
  #7  
Old   
Michael Winter
 
Posts: n/a

Default Re: Newbie: Placing DOCTYPE tag on HTML file screws up formatting - 11-10-2004 , 03:46 AM



On Wed, 10 Nov 2004 01:17:11 +0100, Eric B. Bednarz
<bednarz (AT) fahr-zur-hoelle (DOT) org> wrote:

[snip]

Quote:
IE6 has new, additional bugs in so-called 'standards compliant mode',
[...]
Of course it does! It's IE.

Quote:
Googling for "quirks mode" will turn up a lot of information on the
subject, as will just "doctype".

Googling for 'doctype' reveals predominantly BS.
Googling for many things reveals predominantly BS, but at close to
midnight, I wasn't about to go check the content of the results. Call me
lazy, but sleep was a much more attractive idea. They seemed appropriate
and that was enough for me at the time.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


Reply With Quote
Reply




Thread Tools
Display Modes

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

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.