The page starts with <html> tag and ends with </html> tag.
The <body> tag starts the body. Inside the body you can use several tags to format the page. The body ends with the </body> tag.
<h1> starts a heading, and ends with </h1>. There are 6 heading levels.
<h1>Level 1</h1>
<h2>Level 2</h2>
<h3>Level 3</h3>
<h4>Level 4</h4>
<h5>Level 5</h5>
<h6>Level 6<h6>
<p> and </p> tags contain a paragraph. The <p> tag can have the align property. For example <p align="right"> will align the paragraph to the right. To align to the center you can either use the align property or <center> and </center> tags.
<br> makes a line break. e.g.-
line1<br>line2 makes
line1
line2
The <hr> tag makes a horizontal rule as below
Its height can be set with the size property. Below will make a 1px horizontal rule with no shade.
<hr size="1" noshade>
<a href="index.html">
This makes a link to the homepage.</a>
<a href="http://w3schools.com">
This makes a link to the w3schools.</a>
<a href="#top">
This makes a link to the top of the page.</a>
Similarly at the top the following is written.
<a name="top">HTML Tags</a>
To insert an image the <img> tag is used.
<img src="image.gif">
Here, the address of the image is written inside the quotes.
NOTE: You can simply use the file name if it is in the same directory.
Fonts
To change the font, you can use the <font> and </font> tags. For example
<font color="yellow">This will make yellow font</font>
Physical Font Tags:
<i>Italics</i> Makes:
Italics
<b>Bold</b>
Makes:
Bold
<tt>Typerwriter</tt> Makes:
Typerwriter
<u>Underline</u> Makes:
Underline
<font face="times">Times Roman</font> Makes (if available):
Times Roman
<font face="helvetica">Helvetica</font> Makes (if available):
Helvetica
Browser Sensitive Logical Font Tags:
Logical Fonts are Preferred Over the simpler Physical Fonts
Above, Since the Logical Fonts are more Robust with regard to General
Browsers (i.e., Browser may find a Substitution for a Logical but not
Physical Font
<em>Emphasis</em> Makes (approximates italics):
Emphasis
<strong>Strong</strong> Makes (approximates bold):
Strong
<code>Code</code> Makes (approximates small typewriter): Code
<kbd>Keyboard</kbd> Makes (approximates small bold typewriter):
Keyboard
<cite>Citation</cite> Makes (another approximate italic):
Citation
<dfn>Definition</dfn> Makes (another approximate italic):
Definition
<variable>Variable</variable> Makes (approximates roman):
Variable
<samp>Sample</samp> Makes (another approximate small typewriter):
Sample
HTML Lists
Ordered List:
<ol>
<li>Ordered List Item 1
<li>Ordered List Item 2
<li>Ordered List Item 3
</ol>
Makes the Numbered List:
- Ordered List Item 1
- Ordered List Item 2
- Ordered List Item 3
Unordered List (Unnumbered with Bullets):
<ul>
<li>Unordered List Item 1
<li>Unordered List Item 2
<li>Unordered List Item 3
</ul>
Makes the Unnumbered, Bulleted List:
- Unordered List Item 1
- Unordered List Item 2
- Unordered List Item 3
Preformatted text
preformatted text uses <pre> and </pre> tags. Below is a preformatted table.
1 a
2 b
3 c
Proceed to Html Symbols
Back