HTML - Getting Going


HTML Intro
Getting Started
 
 
 
 
 

Entering tags

Tags are not case sensitive but is it advisable to consistent and to stick to the same method throughout your pages. Popular browsers are very 'forgiving' if you do not form your code properly, but some may not be so. Also if you move to XML (the next version of HTML) sometime in the future, you will need to be more consistent and accurate.

Heading levels

Heading Levels allow you to enter 3 levels of formatting with one bit of code: bold, large and a paragraph break. There are 6 levels to choose from. Add them like this:

<h1>your text here</h1>
<h2>your text here</h2>
...................etc

Horizontal Line

This is an example of an empty tag - it has no closing tag, simply add the code <hr> where you want it to appear. To change the colour of the tag, you need to add an attribute - <hr color="red">. (NB spelling of color). The main colours can be typed as words but generally it is good practise to use hexadecimal codes. Other attributes on the <hr> are as follows

size - by default it is 1 pixel high. Alter this to make it thicker
width - by default it is 100% of browser window. Can alter % or set in pixels
color - as above
align - by default it is aligned to the Center of the page
noshade - adds a solid grey line

Formatting Pages

When you code in Notepad, the browser will ignore your page returns (every time you press Enter) and all but one space between words.

Paragraph tag
<p>your text here</p>

Line Break (gives a smaller space than paragraph break)
<br> at the end of the line

Non-breaking space - special code for a space bar
&nbsp;

Formatting Text

Although font tags are being deprecated (phased out and replaced with style sheets), it is still worth knowing how to alter the look of your fonts.

To make text bold
<b>your text here</b>
To make text italic
<i>your text here</i>

To change font style
<font face="arial">your text here</font>
<font size="x">your text here</font> {sizes are from 1-7, 1 being the smallest, 3 being medium}

Attributes

Attributes are added to to HTML tags to enhance them. Try these examples:
 

To align a paragraph
<p align ="center">your text here</p>
Note: you don't close the attribute, just the tag. Also note the spelling of center.

To add a coloured background to the page (the existing body tag)
<body bgcolor="yellow">your text here</body>

More on attributes on the Tags page

Back to Topindex | email me