HTML Basic Tag List, pg. 2
(all tags come in pairs unless they're marked with an asterisk; these have to be closed with a space and a backslash [ex. <br />])

List Tags
  • <ul> - Defines an unordered list (w/ bullets)
    • type: sets the type of bullet (disc, square, circle)
  • <ol> - Defines an ordered list (w/ numbering)
    • type: sets the numbering used (A, a, I, i, 1)
  • <li> - Defines a list item (it's used with both list types)
    • type: can use the same type info as above
<ul>
<li>red</li>
<li>green</li>
<li>blue</li>
</ul>

Miscellaneous Tags
  • <!--...--> - Defines hidden comments; the dots are replaced with your text
  • <a> - Creates webpage links (internal and external) and e-mail links
    • href: sets the destination of the link (use "mailto:" for e-mail addresses)
    • target: tells the browser how to open a link (_blank, _top, _parent, _self)
<a href="index.html">Home</a>
<a href="http://www.google.com" target="_blank">To Google</a>
<a href="mailto:user@email.com">E-mail me!</a>
  • <img>* - Displays images
    • src: sets which image to display
    • width: sets the width of the image
    • height: sets the height of the image
    • alt: sets the alternative text of the image
    • border: sets the width of the border around a linked image
<img src="rose.jpg" width="50" height="50" alt="A red rose." />
  • <iframe> - Creates an inline frame (loads a webpage within a webpage)
    • src: sets the page to load in the iframe
    • align: sets the alignment of the iframe (left, right, top, middle, baseline)
    • width: sets the width of the iframe
    • height: sets the height of the iframe
    • frameborder: sets the visibility of the frame border (1 or 0)
    • marginwidth: sets the sizes of the left and right margins
    • marginheight: sets the sizes of the top and bottom margins
    • noresize: tells the browser not to allow iframe resizing
    • scrolling: sets the behavior of the scroll bar (yes, no, auto)
<iframe width="760" height="200" src="http://www.yahoo.com">
</iframe>
Form Tags
  • <form> - Defines a user input form; scripts are used to process the data
    • action: tells the form where to send the data collected (URL or e-mail)
    • method: tells the form how to send the data (get, post)
    • name: sets the name of the form
    • target: instructs the form how to open the "action" URL
  • <input>* - Creates a form input field
    • type: sets the field type (checkbox, button, radio, reset, submit, text)
    • checked: checks a box by default
    • maxlength: sets the max number of characters allowed in a text field
    • name: names the field; required for checkbox, radio, text, and others
    • readonly: makes a field read only; it's only used with type="text"
    • size: sets the length of a text input field
    • value: sets the default value of various input field types
<form>
<input type="text" name="name" />
<input type="text" name="email" />
<input type="submit" name="Submit" />
</form>
  • <option> - Defines an option in a dropdown menu
    • selected: sets the default selected option in a menu
    • value: sets the value to be trasmitted by the form
  • <select> - Defines a dropdown menu
    • multiple: allows multiple option selection
    • name: names the dropdown menu
    • size: sets the number of visible items
<select name="fastfood_choices">
<option value="tb">Taco Bell</option>
<option value="hb">Halo Burger</option>
<option value="kfc">KFC</option>
</select>
  • <textarea> - Creates a multi-line input field
    • cols: sets the number of columns in the field; it's required
    • name: sets the name of the textarea
    • readonly: makes the field read only
    • rows: sets the number of rows in the field; it's required
<textarea cols="30" rows="7"></textarea>