Web design - html tags

This page has examples that you can copy and add to your website.

You might find it useful to have TextEdit or NotePad open and AND this page open in a browser tab so you can switch between them.


Name Tag syntax / e.g. Description
HTML <html> </html> Begins and ends document
Head tags
Head <head> </head> Follows opening <html> tag
Title <title>My Biography - Peter Thompson</title> This tag should contain the page title and a brief description of the page contents. It will appear in Google searches and at the top of the browser window.
CSS link <link href="styles.css" rel="stylesheet" type="text/css" /> Links CSS file to current HTML page
Body tags
Body <body> </body> Follows <head> tags. Contains everything visible on page
Container (div tag) <div id="container"> </div> To center your site in the browser windowusing a CSS style
Heading 1 <h1> </h1> Largest heading on page. Should reflect title tag.
Heading 2 <h2> </h2> Medium heading
Heading 3 <h3> </h3> Small heading
Paragraph <p> </p>  
Line break <br />  
Horizontal rule <hr>  
Link <a href="page-file-name-here.html">Link text here</a>  
Div (divisional) <div> </div>
<div id="box"> </div>
<div class="box"> </div>
Good for layout. Defines area of a web page or element on it
Image <img src="image-name-here.jpg" width="72" height="72" /> Images are linked and must be in .gif, .jpg or .png format and at 72ppi resolution