You are on page 1of 5

HTML <body> tag

The body element defines the documents' body. It contains all the contents of the document (like text, images, colors, graphics, etc.).

Example
<html> <head> </head>

<body> The content of the document...... </body> </html>

Optional Attributes
Attribute alink Value rgb(x,x,x) #xxxxxx colorname file_name Description Specifies the color of the active links in the document. Deprecated. Use styles instead.

Background

An image to use as the background. Deprecated. Use styles instead. The background color of the document. Deprecated. Use styles instead.

Bgcolor

rgb(x,x,x) #xxxxxx colorname rgb(x,x,x) #xxxxxx colorname rgb(x,x,x) #xxxxxx colorname rgb(x,x,x) #xxxxxx colorname

Link

Specifies the color of all the links in the document. Deprecated. Use styles instead.

Text

Specifies the color of the text in the document. Deprecated. Use styles instead.

Vlink

Specifies the color of the visited links in the document. Deprecated. Use styles instead.

HTML <br> tag


The <br> tag inserts a single line break. The <br> tag is an empty tag (means that it has no end tag - the following is wrong: <br></br>). Note: Use the <br> tag to enter blank lines, not to separate paragraphs.

Example
Source Output

This text contains<br />a line break This text contains a line break

HTML <!--...--> tag


The comment tag is used to insert a comment in the source code. A comment will be ignored by the browser. You can use comments to explain your code, which can help you when you edit the source code at a later date. You can also store program-specific information inside comments. In this case they will not be visible for the user, but they are still available to the program. A good practice is to comment the text inside the script and style elements to prevent older browsers, that do not support scripting or styles, from showing it as plain text.

Example
Source <!--This text is a comment--> Output

This is a regular paragraph

<p>This is a regular paragraph</p>

HTML <h1> to <h6> tags


The <h1> to <h6> tags define headers. <h1> defines the largest header. <h6> defines the smallest header.

Example
Source Output

<h1>This is header 1</h1> <h2>This is header 2</h2> <h3>This is header 3</h3> <h4>This is header 4</h4> <h5>This is header 5</h5> <h6>This is header 6</h6>

This is header 1
This is header 2
This is header 3 This is header 4 This is header 5 This is header 6

Optional Attributes
Attribute align Value left center right justify Description Specifies the alignment of the text in the header. Deprecated. Use styles instead

HTML <hr> tag


The <hr> tag inserts a horizontal rule.

Example
Source This is some text <hr /> This is some text Output This is some text

This is some text

Optional Attributes
Attribute align Value center left right noshade Description Specifies the alignment of the horizontal rule. Deprecated. Use styles instead

noshade

When set to true the rule should render in a solid color, when set to false the rule should render in a two-color "groove". Deprecated. Use styles instead

size

pixels % pixels %

Specifies the thickness (height) of the horizontal rule. Deprecated. Use styles instead Specifies the width of the horizontal rule Deprecated. Use styles instead

width

HTML <p> tag


Paragraphs are defined with the <p> tag. The <p> tag defines a paragraph.
<p>This is a paragraph</p> <p>This is another paragraph</p>

HTML automatically adds an extra blank line before and after a paragraph.

Example
Source <p>This is some text in a very short paragraph</p> Output

This is some text in a very short paragraph

Optional Attributes
Attribute align Value left right center justify Description Specifies the alignment of the text within the paragraph. Deprecated. Use styles instead

HTML Text Formatting


Text Formatting Tags
Tag <b> <big> <em> <i> <small> Description Defines bold text Defines big text Defines emphasized text Defines italic text Defines small text

<strong> <sub> <sup> <ins> <del> <s> <strike> <u>

Defines strong text Defines subscripted text Defines superscripted text Defines inserted text Defines deleted text Deprecated. Use <del> instead Deprecated. Use <del> instead Deprecated. Use styles instead

"Computer Output" Tags


Tag <code> <kbd> <samp> <tt> <var> <pre> <listing> <plaintext> <xmp> Description Defines computer code text Defines keyboard text Defines sample computer code Defines teletype text Defines a variable Defines preformatted text Deprecated. Use <pre> instead Deprecated. Use <pre> instead Deprecated. Use <pre> instead

Citations, Quotations, and Definition Tags


Tag <abbr> <acronym> <address> <bdo> <blockquote> <q> <cite> <dfn> Description Defines an abbreviation Defines an acronym Defines an address element Defines the text direction Defines a long quotation Defines a short quotation Defines a citation Defines a definition term

You might also like