Location: near Govt College of Science Multan Pakistan
Posts: 9,693
Contact Number: Removed
Program / Discipline: BSIT
Class Roll Number: 07-15
Assignment; web engineering; HTML,
Document Type Declaration
A Document Type Declaration, or DOCTYPE, is an instruction that associates a particular SGML or XML document (for example, a webpage) with a Document Type Definition (DTD) (for example, the formal definition of a particular version of HTML). In the serialized form of the document, it manifests as a short string of markup that conforms to a particular syntax.
The HTML layout engines in modern web browsers perform DOCTYPE "switching", wherein the DOCTYPE in a document served as text/html determines a layout mode, such as "quirks mode" or "standards mode". The text/html serialization of HTML5, which is not SGML-based, uses the DOCTYPE only for mode selection. Since web browsers are implemented with special-purpose HTML parsers, rather than general-purpose DTD-based parsers, they don't use DTDs and will never access them even if a URL is provided. The DOCTYPE is retained in HTML5 as a "mostly useless, but required" header only to trigger "standards mode" in common browsers.
According to HTML standards, each HTML document requires a document type declaration. The "DOCTYPE" begins the HTML document and tells a validator which version of HTML to use in checking the document's syntax.
If standard HTML does not meet your needs but you still wish to gain the benefits of HTML validation, see the section on using a custom DTD.
The following DOCTYPEs are commonly used:
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
This declares the document to be HTML 4.01 Strict. HTML 4.01 Strict is a trimmed down version of HTML 4.01 that emphasizes structure over presentation. Deprecated elements and attributes (including most presentational attributes), frames, and link targets are not allowed in HTML 4 Strict. By writing to HTML 4 Strict, authors can achieve accessible, structurally rich documents that easily adapt to style sheets and different browsing situations. However, HTML 4 Strict documents may look bland on very old browsers that lack support for style sheets.
Newer browsers such as Internet Explorer 5 for Mac, Netscape 6, and Mozilla use a standards-compliant rendering for HTML 4 Strict documents. These browsers use a "quirks" mode for most other document types to emulate rendering bugs in older browsers.
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
This declares the document to be HTML 4.01 Transitional. HTML 4 Transitional includes all elements and attributes of HTML 4 Strict but adds presentational attributes, deprecated elements, and link targets.
Newer browsers such as Internet Explorer 5 for Mac, Netscape 6, and Mozilla use a standards-compliant rendering for HTML 4.01 Transitional documents that include the URI of the DTD in the DOCTYPE. These browsers use a "quirks" mode to emulate rendering bugs in older browsers if the URI is omitted:
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
This declares the document to be HTML 4.01 Frameset. HTML 4 Frameset is a variant of HTML 4 Transitional for documents that use frames.
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
This declares the document to be XHTML 1.0 Strict. XHTML 1.0 Strict is an XML version of HTML 4 Strict.
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
This declares the document to be XHTML 1.0 Transitional. XHTML 1.0 Transitional is an XML version of HTML 4 Transitional.
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
This declares the document to be XHTML 1.0 Frameset. XHTML 1.0 Frameset is an XML version of HTML 4 Frameset.
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
This declares the document to be HTML 3.2. HTML 3.2 is well supported by most browsers in use. However, HTML 3.2 has limited support for style sheets and no support for HTML 4 features such as frames and internationalization.
HTML Code:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
Myths about HTML
There are many myths about HTML (Hypertext Markup Language), the language behind all web pages. The first is that is that HTML is a programming language. It is not. Another myth is that it is not possible to display text vertically. It is. And a final myth is that even if a web page designer can display text vertically in Internet Explorer, they can't do that in Firefox. Guess what. That's right, they can. Myth Number 1: HTML is a Programming Language
HTML (as its name suggests) is a formatting language and nothing more. It enables the web page designer to display text in different ways by using formatting tags, for example:
It is even possible for a web site designer to create their own bespoke tags:
HTML Code:
<head><style>
.myB {
color:white;
background-color:blue;
font-weight:bold;
}
</style></head><body>
Standard formatting and <span class=myB>customized formatting</span></body>
This can be seen in figure 1 at the bottom of this article. However, there is no programming involved. Only formatting. Myth Number 2: Text cannot be displayed vertically
Having dispelled the myth of HTML being a programming language, it's time to consider formatting the text so that it is displayed vertically. And this particular myth evaporated because of Internet Explorer. Microsoft Internet Explorer has, and has had for quite a long time, its own style property – the writing mode property:
HTML Code:
.vertical_text {
writing-mode: tb-rl;
}
The web page creator can then use this, for example as a table heading:
The result can be seen in figure 2 or in Internet Explorer (but not in Firefox). Myth Number 3: Text can be Displayed Vertically in Internet Explorer, But Not Firefox
Having found that it is possible to display text vertically by using an Internet Explorer style property, it will be of no surprise to anyone that this technique will not work with Mozilla Firefox. It will, however, be equally of no surprise to anyone that there is an equivalent style property that works with the Firefox web browser. It is, therefore, just a matter of updating the style definition in either the web page's header or its css (cascading style sheet) file. It's also worth noting that the style's text-align property must be set to "center" for this to work:
This custom style will work with both Firefox 3.5.1 and Internet Explorer 8.0, and enable the web page designer to produce professional looking tables regardless of what they may have heard.
Versions of HTML
HTML is an evolving language, and each new version is given a number. The first definitive version was HTML 2.0 -- this had most of the elements we know and love, but was missing some of the Netscape/Microsoft extensions, and did not support tables, or ALIGN attributes. HTML 3 (late 1995) was an ambitious effort on the part of Dave Raggett to upgrade the features and utility of HTML. However, it was never completed or implemented, although many features were integrated in the next "official" version of HTML, known as HTML 3.2. HTML 3.2 was the next official version, integrating support for TABLES, image, heading and other element ALIGN attributes, and a few other finicky details. HTML 3.2 is the current "universal" dialect -- essentially all browsers understand HTML 3.2. IT was, however, missing some of the Netscape/Microsoft extensions, such as FRAMEs, EMBED and APPLET. Support for these (after a fashion) came in HTML 4.0 HTML 4.01 is the current official standard. It includes support for most of the proprietary extensions, plus support for extra features (Internationalized documents, support for Cascading Style Sheets, extra TABLE, FORM, and JavaScript enhancements), that are not universally supported. Some of these enhancements are not discussed in these online notes. They are discussed in detail in The HTML 4.0 Sourcebook, available in most bookstores.
Software used to create to HTML files (Webpages)
1. Adobe Dreamweaver CS4 2. MS Frontpage 3. Visual Studio 4. Microsoft webpublisher 5. webpage maker 6. WeBuilder 2007 v7.0.1.64 7. Yahoo! Site Builder 8. FlashWebsiteDesignProv1.16563
__________________
(¯`v´¯) `*.¸.*` ¸.*´¸.*´¨) ¸.*´¨) (¸.*´ (¸.Bzu Forum
Don't cry because it's over, smile because it happened
Best view in Firefox Almuslimeen.info | BZU Multan | Dedicated server hosting Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.