Disclaimer: All words, pictures are adopted from Learning Web Design (3 rd eds.) by Jennifer Niederst Robbins, published by O Reilly 2007. Chapter 10: Understanding the Standards CSc2320
In this chapter History of HTML Three Versions: Strict, Transitional, Frameset XHTML and Syntax Document Type Declarations Standards vs. Quirks mode in Browsers Validating Markup Indicating Character Encoding
Why knowing the Standards? Professional web designers know that the best way to ensure consistency and accessibility across multiple browsers and devices is to write standards compliant web documents. Standards compliance simply means that your documents abide by all of the rules in the latest Recommendations published by the World Wide Web Consortium (the W3C). That includes HTML and XHTML for markup, but also other standards for style sheets (CSS) and accessibility.
The birth of HTML 1991: ~1995:
HTML History 1994: Browser started 1996: W3C released HTML 3.2
HTML 4.0 & 4.01 Not over, HTML in three flavors:
Transitional, Strict, Frameset
Meet the DTDs
Enter XML, then XHTML
Rewriting HTML
XHTML Syntax Element and attribute names must be lowercase. All elements must be closed (terminated). Empty elements must be terminated too. Attribute values must be in quotation marks. All attributes must have explicit attribute values. Elements must be nested properly. Always use character entities for special characters. Use id instead of name as an identifier. Scripts must be contained in a CDATA section.
XHTML Syntax Follow additional nesting restrictions.
Namespace and language requirements
From the Browser s Point of View
Declaring the Document Type
Available DOCTYPE declarations
Which One Should You Use?
What the pros do? Follow the XHTML 1.0 Strict DTD No deprecated and presentational elements Use style sheets
Validation your Documents To validate a document is to check your markup to make sure you have abided by all the DTD rules. Right now, browsers don t require documents to be valid. Validation includes: The inclusion of a DOCTYPE declaration. An indication of the character encoding for the document. The inclusion of required rules and attributes. Non-standard elements. Mismatched tags. Nesting errors. DTD rule violations. Typos, and other minor errors. Validation page: http://validator.w3.org/, give a try!!
Character Encoding Web is worldwide, there are hundreds of written languages. Various sets of characters have been standardized. E.g., the set of 256 characters most commonly used in Western languages has been standardized and named Latin-1 (or ISO 8859-1, to use its formal identifier). Unicode Biggest character sets, Unicode (ISO/IEC 10646) number of bytes:utf-8, UTF-16 or UTF-32 UTF-8 is recommended for all HTML 4.01, XHTML, and XML
Specifying the character encoding Way1: ask your server administrator to configure the server to include the character encoding. Way2: W3C also recommends that you include the character encoding in the document itself. In HTML 4.01 and XHTML 1.0 documents, character encoding is indicated using a meta element meta element: empty element provides information about the document e.g., creation date, author, copyright information character encoding and the type of file
Meta element meta element goes in the head of the document Example: The http-equiv attribute identifies that this meta element is providing information about the content type of the document. The content attribute provides the details of the content type in a two-part value. First part says: this is an HTML text file: text/html; The second part that specifies the character encoding for this document as utf-8.
Put It All together
Put It All together
Homework Reading Chapter 10 Quiz 2 on Wednesday (Oct. 6 th ) Excise: Try excise 10-2 on page 178: validating a document, and check the results. From now on, all your assignment (HTML pages) have be validated through w3 validator!!!