HTML Quick Reference

This is not intended to be a definitive list of HTML tags, just a quick reminder of the specific tags we have seen in the course.

For more details, see the HTML Reference.

Document Structure Tags

Opening TagDescription
<html> The “document tag” for HTML documents.
<title> The main page title: tab title and bookmark.
<meta charset="UTF-8" /> Information about how characters are encoded.
<body> Content for the main browser pane.
<script src="…"></script> Link JavaScript code from URL in src.

Block/Sectioning Tags

Opening TagDescription
<section> Section/subsection of the page: containing a heading (<h2> or <h3>) and content.
<h1> Level 1 heading: probably one, same as <title>.
<h2> Level 2 heading: for sections of the page.
<h3> Level 3 heading: for sub-sections of the page.
<p> A paragraph.
<ul> Unordered list: contains only <li>.
<ol> Ordered list: contains only <li>.
<li> List item: must go in a list element.
<dl> List of definitions: contains only <dt> and <dd>, probably in pairs.
<dt> Term being defined: must be in <dl>.
<dd> Definition of last <dt>: must be in <dl>.
<figure> A figure, probably with a <figcaption>.
<figcaption> The caption for a figure: must be in <figure>.
<address> Contact information for the author.
<div> Generic block-level tag: must have meaningful class/id.

Inline Tags

Opening TagDescription
<a href="…"> A link to the URL in href.
<abbr title="…"> An abbreviation, with full term in title.
<cite> A citation: reference to another work.
<code> An example/fragment of computer code.
<dfn> Newly-defined term.
<em> Emphasized text.
<img src="…" alt="…" /> Image inserted from URL in src and alternate text in alt.
<q> An inline quotation.
<span> Generic inline tag: must have meaningful class/id.
<strong> Strongly emphasized text.

Forms

Tag/ExampleDescription
<button>Go</button> A clickable button.
<input type="text" /> A one-line text input.
<input type="password" /> A text input with entered text not visible.
<select>
<option value="a">A<option>
</select>
Input with a fixed set of options.
<textarea></textarea> A multi-line text input.