Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are Doctype declarations split on two lines?

Tags:

html

I know there's more important questions to discuss probably, but at the cost of appearing a fool, I'd like an answer ;-)

Take this for instance:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

Is it to comply to the 80 column standard? Also, i normally use single quotes in my HTML as they're easier on the eye, does it make any difference to browsers? Will it send IE6 in quirks mode putting it on one line and single-quoting attributes?

Thanks

like image 284
Lorenzo Avatar asked Mar 24 '09 23:03

Lorenzo


People also ask

What is the purpose of the doctype declaration?

Doctype HTML is a declaration that tells the browser what version of HTML the document is written in. This declaration appears as the very first line in an HTML file.

What does DOCTYPE must be declared first?

The error looks like a warning: “Doctype must be declared first.” The browser needs to understand which types of HTML and CSS you are using and render the page in standard mode. The absence of the DOCTYPE or its incorrect usage will force the browser to switch to quirks mode.

How many doctype declaration can a HTML5 document have?

Types: In the previous versions of HTML, there were different kinds of Doctypes that were declared in each version of HTML, but in HTML5 there is only one type of Doctype available.

Is doctype declaration mandatory?

All HTML documents must start with a <!DOCTYPE> declaration. The declaration is not an HTML tag. It is an "information" to the browser about what document type to expect.


1 Answers

It's just line-wrapping.

Also, XML will take either quote mark, but convention is the double quote.

like image 164
Alnitak Avatar answered Oct 03 '22 15:10

Alnitak