HTML and CSS Reference
In-Depth Information
Appendix A
HTML Quick Reference
HTML Coding Standards
HTML is the original language used for publishing hypertext on the World Wide Web.
It is a nonproprietary format based on Standard Generalized Markup Language (SGML).
HTML documents can be created with a wide variety of tools, from simple text editors
such as Notepad and Notepad++, to sophisticated WYSIWYG authoring tools such as
Adobe Dreamweaver. Extensible Markup Language (XML) is a markup language that uses
tags to describe the structure and content of a document, not just the format.
Extensible Hypertext Markup Language (XHTML) is a reformulation of HTML
so it conforms to XML structure and content rules. By combining HTML and XML,
XHTML provides the display features of HTML and the stricter coding standards
required by XML.
HTML5 is the newest version of HTML. HTML5 is a very flexible language that
does not have coding standards like the XHTML standards defined by the World Wide
Web Consortium (W3C). For instance, with HTML5, you can combine lowercase, upper-
case, or mixed-case lettering in your tags and attributes. Despite the HTML5 flexibility,
this topic adheres to good coding practices (other than the XHTML <!DOCTYPE> tag)
that would make it easy to convert to XHTML standards if they should one day override
HTML5. The coding practices to which the topic adheres are shown in Table A-1. The
projects in this topic use the HTML5 <!DOCTYPE> tag and follow the standards
outlined in Table A-1. This information is also shown in Table 1-3 in Chapter 1.
Table A-1 Coding Practices
Practice
Invalid Example
Valid Example
All tags and attributes
must be written in
lowercase
<IMG HEIGHT=”346” />
<img height=”346” />
All attribute values
must be enclosed
by single or double
quotation marks
<img height=346 />
<img height=”346” />
All tags must be closed,
including tags such as
img, hr, and br, which
do not have end tags,
but which must be
closed as a matter of
practice
<br>
<hr>
<p>This is another paragraph
<br />
<hr />
<p>This is another paragraph</p>
All elements must be
nested properly
<p><strong>This is a bold
paragraph</p></strong>
<p><strong>This is a bold
paragraph</strong></p>
Search WWH ::




Custom Search