Selected HTML Syntax

Part of HTML5 and CSS3 All-in-One For Dummies Cheat Sheet

Despite all the new programming languages and technology, HTML remains the basic building block for a lot of websites. This table contains the most commonly-used HTML tags.

Tag Comments
<html></html> Required for all pages.
<head></head> Required for all pages — must be inside HTML tags.
<title></title> Must be in head.
<body></body> Required for all pages — must be inside HTML tags.
<link rel = “stylesheet” type =
“text/css” href = “address” />
Link to external style sheet. Replace address with URL of style
<style type =
Page-level style sheet declaration.
<h1></h1> ..
Defines headline from most prominent (h1) to least prominent
<p></p> Paragraph.
<div></div> Generic block-level component.
<span></span> Generic inline component.
<em></em> Emphasis (default: italics).
<strong></strong> Strong emphasis (default: bold).
<br /> Line break.
<ol></ol> Defines an ordered list.
<ul></ul> Defines an unordered list.
<li></li> List item — must be inside ol or ul pair.
<dl></dl> Definition list — a list of terms and definitions.
<dt></dt> Definition term — found in dl groups.
<dd></dd> Definition data — usually paired with a dt set inside a
<a href =
Displays content as a link, and sends browser to address when
<img src = “filename” alt =
“alternative text” />
Displays image referenced by filename. Alternative text is
required for non-visual browsers.
<table></table> Define an HTML table.
<tr></tr> Table row.
<th></th> Table header — must be inside tr.
<td></td> Table data — must be inside tr.
<script></script> Internal JavaScript code.
<script src =
Load external JavaScript code.
Conditional comment. Code inside these tags will only be
executed by Internet Explorer. It’s possible to indicate
specific versions as well (<!—[if IE
< 7]>