Which doctype to use
While no longer in general use, there are several other doctype declaration types from previous versions of HTML. There are also specific versions for XML documents. To read more about these, and to see code examples for each, take a look at the Wikipedia article. If this article was helpful, tweet it. Learn to code for free. Get started. Forum Donate. Three separate rendering modes were generally available across browsers.
Now, that may look like a lot of nonsense to you, so let me offer a somewhat simplified explanation of how it is constructed.
For a much more detailed look at exactly what each character refers to, see the article! The most important parts of the doctype are the two strings delimited by quotes.
Some web browsers even contain such functionality by default, while others can have it added by installing an extension. Most web browsers released in the 21st century look at the doctype of any HTML documents they encounter and use that to decide whether the author of the documents took care to write their HTML and CSS properly according to web standards.
In standards mode, browsers generally try to render the page according to the CSS specifications—they trust that the person who created the document knew what they were doing. As a web designer or developer, you will get the most consistent results by making sure that all browsers use their Standards rendering mode, hence you should stick to web standards, and use a proper doctype! As I mentioned earlier, the doctype is also used by validators, which you will learn more about later in this article series.
Post as a guest Name. Email Required, but never shown. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta. Now live: A fully responsive profile. Related Hot Network Questions. Question feed. HTML 4.
XHTML 1. Example Copy. Previous Topic Next Topic. Learn more. Character Encoding. HTML Tags.
0コメント