How 2 Create A Website | HTML Tutorials - Body Section
HTML Body Tags
Between the body tags your content will be written. Body attributes e.g. background, text color, hyperlink colors can now be done with CSS.
In HTML 4 there are two attributes that are used.
- Onload
- Unload
The above are used with scripts.
Here is an example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head> <body onload="alert('This is a test!')" > </body> |
Test html onload body tags example here
If you open the this html code in a web browser then "This is a test!" will popup.
Let's look at other tags that you can use between the <body> </body> tags.
Paragraphs
A handy tag to use to separate text into paragraphs is the paragraph tag <p> </p>.
These tags add a blank line before and after the text text they enclose. In older browsers you only need the <p> tag to create a paragraph.
Example:
This is a test 1. This is a test 2. this is a test 3.
The result is as follows:
This is a test 1.
This is a test 2.
This is a test 3.
The code:
<p>This is a test 1.</p>
<p>This is a test 2.</p>
<p>This is a test 3.</p>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head> <body> <p>This is a test 1.</p> </body> |
Test html paragraph tags example here
HTML Blockquote
Blockquote tags can be used to insert small snippets of quoted text in regular content.
<blockquote> </blockquote>
HTML Line Breaks
The line break tag <br> places a break after the end of a line of text and then goes to the next line.
Example:
The following sentences is a test. Will look as follows.
The following sentences is a test.
Will look as follows.
The code:
<p>The following sentences is a test. <br>Will look as follows.</p>
Document Headings
When you create a webpages then it will be a good idea to have headings for your articles. HTML headings are used just like headings in books and newspapers. Headings divide various sections on your pages.
HTML have 6 heading sizes. It start from 1 to 6.
<body> <h1> H1 Font </h1> <h2> H1 Font</h2> <h3> H1 Font</h3> <h4> H1 Font</h4> <h5> H1 Font</h5> <h6> H1 Font</h6> </body> |
This is the result of the above html code.
Changing the font type, color and size of a phrase or word is common in HTML authoring. To add text to a web page, the simply add the text between the <body> </body> tags.
Formatting Text
HTML include elements that can change the style of text.
|
Example:
|
Other text formatting include:
|
Formatting Font Size, Face And Color
<body> <p><font face="Times New Roman" color="#008080" size="5">This an example of text formatting</font></p> </body> |
This is how it will look:
This an example of text formatting
The above metioned tags are just a couple of tags that can be used between the body tags.
next | working with html code tutorials

