HTML CHEATSHEET!

Basic Tags

<html> </html>

HTML Tags are created to create HTML document

<title> </title>

Title tag puts the name in the title bar when bookmarking pages

<head> </head>

Head tag is used to contain all the head elements in the HTML document

<body> </body>

Body tag is used to contain all the body elements in the HTML document

<footer> </footer>

Footer tag is used to define a footer for a document or section

Formatting

<p> </p>

Paragraph tag is used to define a paragraph in the HTML document

<br> </br>

Break tag is used to break the line

<div> </div>

Div tag is used to define a division or a section in an HTML document

<span> </span>

Span is used to format inline content with CSS

Tables

<table> </table>

Table tag is used to create a table in the HTML document

<tr> </tr>

Table row tag is used to define a row in the table

<td> </td>

Table data tag is used to define a cell in the table

<th> </th>

Table header tag is used to define a header cell in the table

Tag Name Description
<table> Table The wrapper element for all HTML tables.
<thead> Table Head The set of rows defining the column headers in a table.
<tbody> Table Body The set of rows containing actual table data.
<tr> Table Row The table row container.
<td> Table Data The table row container.
<tfoot> Table Foot The set of rows defining the footer in a table.

Table Attributes

<table width=?>

Width attribute is used to set the width of the table

<table border=?>

Border attribute is used to set the border of the table

<table cellspacing=?>

Cellspacing attribute is used to set the space between the cells

<table cellpadding=?>

Cellpadding attribute is used to set the space between the cell wall and the cell content

<tr align=?>

Align attribute is used to set the alignment of the row(left/center/right)

<td align=?>

Align attribute is used to set the alignment of the cell(left/center/right)

<tr valign=?>

Align attribute is used to set the alignment of the row(top/middle/bottom)

<td valign=?>

Align attribute is used to set the alignment of the cell(top/middle/bottom)

<td rowspan=?>

Rowspan attribute is used to set the number of rows a cell should span

<td colspan=?>

Colspan attribute is used to set the number of columns a cell should span

Lists

<ul> </ul>

Unordered list tag is used to create an unordered list

<ol> </ol>

Ordered list tag is used to create an ordered list

<li> </li>

List item tag is used to define a list item

Text Tags

<h1> </h1>

Heading tag is used to define a heading, heading go from h1(most important) - h6(least important)

<b> </b>

Bold tag is used to make the text bold

<i> </i>

Italic tag is used to make the text italic

<u> </u>

Underline tag is used to underline the text

<em> </em>

Emphasized tag is used to emphasize the text

<strong> </strong>

Strong tag is used to make the text strong

Forms

<form> </form>

Form tag is used to create a form in the HTML document

<select name=?> </select>

Select tag is used to create a dropdown list

<option> </option>

Option tag is used to define an option in the dropdown list

<textarea> </textarea>

Textarea tag is used to create a multi-line text input field

<button> </button>

Button tag is used to create a clickable button

<label> </label>

Label tag is used to define a label for an input element

<fieldset> </fieldset>

Fieldset tag is used to group related elements in a form

<legend> </legend>

Legend tag is used to define a caption for a fieldset element

Input Tags

<input type="text">

Input tag is used to create an input field

<input type="radio">

Radio tag is used to create a radio button

<input type="checkbox">

Checkbox tag is used to create a checkbox

<input type="submit">

Submit tag is used to create a submit button

<input type="reset">

Reset tag is used to create a reset button

<input type="password">

Password tag is used to create a password field

<input type="file">

File tag is used to create a file select box

<input type="hidden">

Hidden tag is used to create a hidden input field

<input type="image">

Image tag is used to create an image as a submit button

<input type="date">

Date tag is used to create a date field

<input type="color">

Color tag is used to create a color picker

<input type="range">

Range tag is used to create a range slider

<input type="number">

Number tag is used to create a number field

<input type="email">

Email tag is used to create an email field

<input type="tel">

Tel tag is used to create a telephone field

<input type="url">

URL tag is used to create a URL field