===== HTML Cheat Sheet ===== This is a summarized form of the [[http://www.w3schools.com/html/default.asp | HTML Tutorial]]. For reference this is the [[http://www.w3.org/TR/REC-html40 | HTML Specification]] . ==== What is HTML ==== * HTML stands for Hyper Text Markup Language. * An HTML file is a text file containing small markup tags telling a web browser how to display the page. It must end with **htm** or **html**. * A simple HTML web page Title of page This is my first webpage. * HTML 4 comes in three versions : * Strict which contains no deprecated elements or frames * Transitional which includes deprecated elements * Frameset which includes deprecated elements and frames ==== HTML Components ==== * HTML documents are text files consisting of HTML elements. * HTML elements are defined using HTML tags. [[http://www.w3schools.com/tags/ref_byfunc.asp | HTML Tag Reference]]. * HTML tags contain the element name surrounded by angle brackets (** < > **). * HTML tags normally come in pairs - the **start tag**(

) and the **end tag** (

). * The text between the start tag and the end tag is the element content. * HTML tags may contain attributes with values specified in the start tag e.g.

. * Attribute values should always be either single or double-quoted. * Element and attribute names are not sensitive but lowercase names are recommended and required in XHTML. * [[http://www.w3schools.com/tags/ref_standardattributes.asp | Standard attributes]] valid for most elements include: class, id, title, style, lang. ==== Formatting Tags ==== * Basic tags *

...

defines a paragraph. *
is a line break (a self-closed tag). *
is a horizontal line. * is a comment. * Physical formatting tags *

to

defines headers level 1 through 6. * - **bold**, - //italic//, - //emphasized//, ,, , . * is for deleted text, for __inserted text__. *
 ... 
contains pre-formatted text. *
is used for a long quote, for a short quote. * Logical Formatting Tags * < code>, , , , are computer-related text tags. * UN * WWW *
is for addresses * is for citations, for definitions. ==== Lists & Tables ==== *
- Unordered list, can have type disc, circle, square. *
- Ordered list, can have type A, a, I, i. *
- Definition list *
My Table
header 1 header 2
row 1-cell 1 row 1-cell 2
* A table with border 0 can be used to format the layout of a page. * A table can also be in the form: , but all three must be specified and contain at least one row. * To set attributes of columns in a table, a colgroup with column entries can be used e.g. ...
==== Forms ==== * Forms are areas that contain form elements used to allow the user to enter and submit information e.g.
* Valid input types include: text, radio/checkbox (checked="checked"), button (also - another button ==== Other Tags ==== * <**a href**="url/#anchor" target="_top/_blank/framename"> - a link. Always add the trailing slash for a folder to prevent an extra request. * <**a href**="mailto:a@b?subject="> - E-mail link * <**a name**=""> - an anchor (webpage bookmark) *<**img** border=0 src=url width=0 height=0 alt="alt text"> - an image. Align can be set to bottom/top/middle/left/right. * <**frameset** cols/rows="25%,50%,25%"> - a vertical or horizontal set or frames. * <**frame** src="frame_a.htm"> - a single frame * <**noframes**>