HTML Cheat Sheet This cheat sheet - or HTML code quick reference - lists the common HTML tags and their attributes, grouped into relevant sections in an easy-to-read format. Basic HTML Structure website title content of website ... The Basics ... Heading (?= 1 for largest to 6 for smallest, eg h1)

...

Paragraph of Text ... Bold Text ... Basic Link Text Formatting ... Heading (?= 1 for largest to 6 for smallest, eg h1) ... Bold Text ... Italic Text ... Underline Text ... Strikeout ... Superscript - Smaller text placed below normal text ... Subscript - Smaller text placed below normal text ... Small - Fineprint size text ... Typewriter Text
 ... 
Pre-formatted Text
...
Text Block Quote ... Strong - Shown as Bold in most browsers ... Emphasis - Shown as Italics in most browsers ... Font tag obsolete, use CSS. (*) Section Divisions
...
Division (or Section) of Page Content

...

Paragraph of Text
Line Break
Basic Horizontal Line
Tag Attributes: size="?" Line Thickness in pixels width="?" Line Width in pixels width="??%" Line Width as a percentage color="#??????" Line Colour (*) align="?" Horizontal Alignment: left, center, right (*) noshade No 3D cut-out ... Line Break Images text Basic Image Tag Attributes: src="url" URL or filename of image (required!) alt="text" Alternate Text (required!) align="?" Image alignment within surrounding text (*) width="??" Image width (in pixels or %) height="??" Image height (in pixels or %) border="??" Border thickness (in pixels) (*) vspace="??" Space above and below image (in pixels) (*) hspace="??" Space on either side of image (in pixels) (*) Linking Tags link text Basic Link Tag Attributes: href="url" Location (url) of page to link to. name="??" Name of link (name of anchor, or name of bookmark) target="?" Link target location: _self, _blank, _top, _parent. href="url#bookmark" Link to a bookmark (defined with name attribute). href="mailto:email" Link which initiates an email (dependant on user's email client). Lists
    ...
Ordered List Un-ordered List
  • ...
  • List Item (within ordered or unordered)
      Ordered list type: A, a, I, i, 1
        Ordered list starting value
          Unordered list bullet type: disc, circle, square
        • List Item Value (changes current and subsequent items)
        • List Item Type (changes only current item)
          ...
          Definition List
          ...
          Term or phrase being defined
          ...
          Detailed Definition of term Tables ...
          Define a Table Tag Attributes: border="?" Thickness of outside border bordercolor="#??????" Border Colour cellspacing="?" Space between cells (pixels) cellpadding="?" Space between cell wall and content align="??" Horizontal Alignment: left, center, right (*) bgcolor="#??????" Background Colour (*) width="??" Table Width (pixels or %) (*) height="??" Table Height (pixels or %) (*) ... Table Row within table Header Cell within table row Table Cell within table row
          ... ... Tag Attributes: colspan="?" Number of columns the cell spans across (cell merge) rowspan="?" Number of row a cell spans across (cell merge) width="??" Cell Width (pixels or %) (*) height="??" Cell Height (pixels or %) (*) bgcolor="#??????" Background Colour (*) align="??" Horizontal Alignment: left, center, right (*) valign="??" Vertical Alignment: top, middle, bottom (*) nowrap Force no line breaks in a particular cell Frames ... Define the set of Frames Tag Attributes: rows="??,??, ..." Define row sizes & number of rows (size in pixels or %) cols="??,??, ..." Define column sizes & number of columns (size in pixels or %) noresize="noresize" User cannot resize any frames in frameset ... Define a frame within the frameset Tag Attributes: src="url" Location of HTML File for a frame name="***" Unique name of frame window marginwidth="?" Horizontal margin spacing inside frame (pixels) marginheight="?" Vertical margin spacing inside frame (pixels) noresize="noresize" Declare all frameset sizes as fixed scrolling="***" Can the user scroll inside the frame: yes, no, auto frameborder="?" Frame Border: (1=yes, 2=no) bordercolor="#??????" Border Colour (*) ... Unframed content (for browsers not supporting frames) Forms Help Help | Top Top
          ...
          Form input group decleration
          Tag Attributes: action="url" URL of Form Script method="***" Method of Form: get, post enctype="***" For File Upload: enctype="multipart/form-data" ... Input field within form Tag Attributes: type="***" Input Field Type: text, password, checkbox, submit etc. name="***" Form Field Name (for form processing script) value="***" Value of Input Field size="***" Field Size maxlength="?" Maximum Length of Input Field Data checked Mark selected field in radio button group or checkbox Select options from drop down list Large area for text input