HTML Miscellaneous Notes



index
Disabled back button Next Section
printable version

Section 1: HTML Elements

No doubt you have noticed by now that HTML documents are comprised of elements.



Tag Considerations

HTML5 tag names are case insensitive and may be written in all uppercase or mixed case, although the most common convention is to stick with lowercase.

Section 2: Standards

It is important to follow standards when developing web sites. Sitepoint provides a great discussion why in their article titled The Importance of Web Standards.

In addition to those, there are some common conventions that I want you to follow when writing HTML code.


Nesting

All elements must be properly nested within each other like this:

<p>Here is a <a href="http://www.isu.edu">link to ISU.</a></p>


Closing Tag

All elements must have the closing tag, as in the following examples:

<p>This is a paragraph.</p>
<p>This is another one.</p>


Close Empty Elements

Elements that do not require a closing tag are called empty elements. Empty elements must have an end tag, i.e., the start tag must end with />.

A break: <br/>
A horizontal rule: <hr/>
An image: <img src="happy.gif" alt="Happy face"/>


Use Lower Case for Elements

Tag names and attributes need to be lower case.

<p>This is correct.</p>


One Root Element

All elements must be nested within the html root element.

Section 3: Character Entities

Sometimes you want to include a character on your page that isn't on the keyboard.

Other times you need to use a character that is reserved for use by HTML.

Character entity references, or entities for short, provide a means of entering characters that cannot be expressed in the document's character encoding or that cannot easily be entered on a keyboard.

Here is a table of some common character entities that you might use.

Character Description Entity Name Entity Number
  non-breaking space &nbsp; &#160;
< less than &lt; &#60;
> greater than &gt; &#62;
& ampersand &amp; &#38;
¢ cent &cent; &#162;
£ pound &pound; &#163;
¥ yen &yen; &#165;
euro &euro; &#8364;
§ section &sect; &#167;
© copyright &copy; &#169;
® registered trademark &reg; &#174;
trademark &trade; &#8482;
é e acute &eacute; &#233;

Codes for more reserved characters can be found at the W3Schools HTML Symbol Entities.

Character Entities can also be used to include foreign characters in a document.

Section 4: Favicon

Although this has little to do with HTML, many students ask how to change the image associated with a web site in the browser's address bar, in browser tabs, and in bookmarks.

A favicon is a graphic image (icon) associated with a particular Web page and/or Web site.

Section 5: Let's Play

Click the "Edit and Click Me >>" to see the results of the html code in the left panel in the panel on the right.

Then, play around with the html code, making changes and seeing the effect of those changes in the right panel.