All <bracketed> tags have a corresponding </bracketed> tag unless otherwise noted.
|
HTML tag
|
Usage
|
|
&
|
Ampersand: &.
|
|
©
|
Copyright symbol: ©.
|
|
>
|
Greater than symbol: >.
|
|
<
|
Less than symbol: <.
|
|
|
Non-breaking space. Inserts a space but prevents the browser from wrapping the line there. "What's New" in the sidebar at left contains a non-breaking space.
|
|
<!-- -->
|
HTML comment. Inserts a comment in HTML code. The browser ignores everything between <!-- and --> even if it includes HTML tags. I use HTML comments to make my code more readable.
|
|
<a>
|
Anchor tag. Inserts a hypertext reference or named location into a web document.
Attributes:
|
href="URL"|"#name"
|
Hypertext referece. Specify URL to link to another document, or #name to link to another place in the current document.
|
|
name="name"
|
Inserts a named location. Use href="#name" to link to the named location from elsewhere in the document
|
|
|
<address>
|
Web page address info. See the bottom of this page for an example. Mine gives copyright info, last modified date, and the URL. Use the break tag <br /> to insert line breaks in the address. Attribute: class="text". Class specified in the Cascaded Style Sheet.
|
|
<base>
|
Base reference location. Specifies the default directory for files if the full file path is not specified. Attribute: href="URL", the URL of the default directory. Goes in the document head.
|
|
<body>
|
Body. Encloses the text, etc. to be displayed in the browser. Attribute: class="text". Class specified in the Cascaded Style Sheet.
|
|
<br />
|
Break. Inserts a line break in the document. There is no corresponding </br> tag. The slash after the "br" closes the tag.
|
|
<caption>
|
Table caption. Displays a caption for the table.
Attributes:
|
align="left"|"center"|"right"
|
Alignment. Defaults to center.
|
|
|
<em>
|
Emphasized text. Displays as italic. I use this for book titles, etc.
|
|
<h1>
|
Header level 1 text. "Richard's Index" at the top of this page is Header level 1 text. Attribute: class="text". Class specified in the Cascaded Style Sheet. Lower-level headers also have this attribute, but I don't use it for them much.
|
|
<h2>
|
Header level 2 text. "Work -- HTML Quick Reference" on this page is Header level 2 text.
|
|
<h3>
|
Header level 3 text. "Usage," above, is Header level 3 text. Header levels go down to 8, but I don't use headers below level 3 very much.
|
|
<head>
|
Document head. Mine contains meta tags, title, base declaration, and a link declaration for the Cascaded Style Sheet.
|
|
<hr />
|
Horizontal rule. Displays as a horizontal line across the page. There is one at the bottom of this page between the "Return to" information and the address information. There is no corresponding </hr> tag. The slash after the "hr" closes the tag.
|
|
<html>
|
Encloses all the HTML code on the page. On most pages, <html> is the very first tag, and </html> is the very last tag. The main parts of a HTML document are the head and body.
|
|
<li>
|
List item. An unordered list contains one or more list items.
|
|
<link>
|
Link information. Gives information about an external file used by the web page. Goes in the document head. I use it to specify the Cascaded Style Sheet file. Attributes: rel="stylesheet" type="text/css" href="index.css".
|
|
<meta>
|
Metadocument information. Goes in the document head. Attributes: name="text" content="text". The name attribute gives the type of information, and the content gives the information itself. I use meta tags to give a brief document description (name="description") and the search engine keywords (name="keywords").
|
|
<p>
|
Paragraph. I usually enclose text between paragraph tags if it's not in a list item or a table cell. Attribute: class="text". Class specified in the Cascaded Style Sheet.
|
|
<span>
|
Inline formatting for a span of text. Attribute: class="text". Class specified in the Cascaded Style Sheet.
|
|
<strong>
|
Strong emphasis. Displays as bold text.
|
|
<table>
|
Table. Used to insert a table into a HTML page. Tables contain rows and data cells, and can have captions. Tables can be nested. This table is nested within another table, and the Attributes list below is a table within a table within a table.
Attributes:
|
border="number"
|
Border width in pixels. Should default to 1, but for some reason my browser doesn't show the border unless I specifically define it as being 1.
|
|
cellpadding="number"
|
Padding between data cells in pixels. Defaults to 1. I set it to 5 in this table.
|
|
class="text"
|
Class specified in the Cascaded Style Sheet.
|
|
|
<td>
|
Table data cell. Each row in a table contains one or more data cells.
Attributes:
|
class="text"
|
Class specified in the Cascaded Style Sheet.
|
|
colspan="number"
|
The cell spans the specified number of columns.
|
|
valign="top"|"center"|"bottom"
|
Vertical alignment. Defaults to center. Personally, I find this annoying.
|
|
|
<title>
|
Title. Goes in the document head. Specifies the title of the web page. The title is usually displayed in the title bar of the browser window.
|
|
<tr>
|
Table row. A table contains one or more rows, and each row contains one or more data cells..
|
|
<ul>
|
Unordered list. Contains one or more list items. Displays as a bullet list. Unordered lists can be nested. Nested lists are indented from the parent and have different bullet styles.
|