Website Template

The HTML document So far, you’ve been taking the HTML code fragment of the full HTML-ortions document. In this section you will learn how to put it all together and create the first original site. The Document Type Definition In the early days of the Internet, web browsers were full of quirks. When people Recommended web sites, they had to take these problems into account. For example, browser will also calculate the text box floating gently around the edges of different way, which side looks like a good browser, but it seems strange to another. Years later, the rules (HTML and CSS, the stylesheet standard then consider 6. chapter) would be a single detail. With these new rules, all browsers can be displayed on the same page in exactly the same way. But this change caused a serious long-lived headache browsers to the dark age HTML, such as Internet Explorer. They had to somehow support the new browsers 2. Chapter created the first 31st Page The HTML document standards, while still being able to properly display the existing web sites, including those that relied on the old quirks. The Internet community settled down to a simple solution. When planning a new, modern website, you indicate that fact to the code, called the document type definition (DTD) or doctype, which goes to the very beginning of the HTML document (Figure 2-6). Figure 2-6: The document type definition (DTD) for the first piece of information to an HTML file. It tells the browser what marking standards with which to write the page. When the browser encounters a page in a doctype, you can turn on standards mode. Then the page displays the most consistent, standardized manner possible. In the end, It follows that the page looks almost the same in all modern browsers. But when the browser encounters an HTML document that does not have a doctype, all bets are off. Some, such as Internet Explorer, switch to the dreaded quirks mode. When The quirks mode, Internet Explore try to behave the same way previous versions was 10 years ago, quirks and all. This ensures that a very old web pages look the way they are back when you first set up, even if you rely on browser bugs ancient that has long been settled. Unfortunately, different browsers have different features. So if you are not viewing the page doctype multiple browsers, you can probability that the different sizes of text, borders, margins and inconsistent, and wrong content is located. For this reason, web pages without doctype bad news, and do not create them. Web designers in different doctype that they indicate the standard marker uses (eg, XHTML, HTML5, HTML 4.01, or indeed the old). However, the browsers Doctype you have a dirty secret: not really care what you say about the doctype. Simply interested to have a doctype. This is because almost all doctypes trigger Standard mode. So it may be the site for an XHTML 1.0 doctype, but it HTML5 content inside, and the browser will not mind at all. Today, most web developers use the HTML5 doctype, which looks like this: 32 Website Creation: The Missing Manual The HTML document