HTML Tutorials - Herong's Tutorial Examples
∟HTML Document and Elements Syntax
This chapter provides tutorial notes and example codes on HTML document syntax. Topics include what is HTML document syntax; character set and encoding; entering comments; opening and closing tags; nested elements; specifying attribute values and element contents; using whitespace characters; using character entity and numeric character references.
HTML Document Syntax
Document Character Set and Encoding
Entering Comments in HTML Document
Opening and Closing Tags of Elements
Using Nested Elements
Specifying Element Attributes
Specifying Element Contents
Element Content Syntax Types
Using Whitespace Characters
Using Character Entity References
Using Numeric Character References
Takeaways:
- An HTML5 document begins with <!DOCTYPE html> declaration.
- An HTML5 document has a single root element "html".
- <meta charset="encoding_name"> meta element helps browser to decode the HTML document correctly.
- <!-- comment --> comments can be entered anywhere in element contents.
- Void elements or empty content elements do not allow any contents and closing tags.
But the self-closing opening tag like "<br/>" is recommended.
- Element contents may be closed by implicit closing tags triggered by subsequent opening tags.
But closing element contents with explicit closing tags is recommended.
- Element names and attribute names are case insensitive.
But lower case letters are recommended.
- Whitespace characters in element contents are collapsed to single space characters.
Leading and trailing whitespace characters in element contents are also trimmed.
- Character entity references and numeric character references can be using attributes and element contents.
Table of Contents
About This Book
Introduction of HTML
Introduction of HTML5 Features
HTML Document Structure and Content
►HTML Document and Elements Syntax
Displayed and Printed HTML Documents
Responsive Design of Web Pages
MathML Integration in HTML Documents
References
Full Version in PDF/EPUB