Dave Carr's html Cheat-Sheet
(a work in progress by Net11 student David Carr)
Emphasis tags and attributes
- bold
- Use these tags for <b>
bold </b>
- italics
- Use these tags for <i>
italics </i>
bold/italicsUse these tags in combination for <b><i> bold/italics </i><b>
A note about nesting
Fonts
- monospacing
- Old fashioned typewriters used monospacing with every character occupying the same space. This style has advantages and is typically used when demonstrating code samples and for heading. Use these tags for <tt>monospacing (or typwriter text).</tt>
- font size
- Use a tag with an attribute for the font size required. There are seven different font sizes from <font size="1"> 1 (the smallest) </font> to
<font size="7"> 7 (the largest). </font> The default size is 3. - font style
- Use a tag with an attribute for the font style required. This tag will produce <font face="arial"> arial. </font>
- Not every computer has access to every font so it pays to be cautious with the fonts used. You can select a number of fonts,
eg <font face="helvetica,lucida sans,arial black, arial"> and the browser will default through the list until it finds one that works. - big tags and small tags
- Another set of useful tags are the <big> big tags </big> and the <small> small tags </small> which bump the font size up or down one level.
- font colour
- Use the font tag with a colour attribute (note the American spelling) to change the color to <font color="#ff0000"> red </font>, <font color="#3300FF"> blue </font>, <font color="#33CC00"> green </font> or <font color="#FF33FF"> pink </font>.
This lists the available colour.
Formatting
- new line or "return"
- html does not recognise format and must be instructed when to "return"
<br>or start a new line. Each
<br> forces a "return".
- paragraph tags
- These act as containers for text and automatically stat with a new line. They may also be aligned using attributes to;
<p align="left">align to the left;
<p align="center">align in the centre (watch that American spelling again); or
<p align="right">align to the right
- centre text
- This can also be achieved with a: <center> center tag. </center>
- spaces (non-breaking spaces
- Browsers only recognise one space. To overcome this problem, html uses the following code to represent the special character of a space: & The & indicates the start of a special character, nbsp indicates the character desired, in this case a non-breaking space and ; indicates the end of the specal character.
This creates spaces wherever you want.
- other special characters
- Some other special characters can be found here.
Images
- Inserting images
- The <img> tag is used to insert images. It is also necessary to specify the source (this tells the browser where to locate the image) and the size (width and height. The image at the top of this page was inserted by: <img src="htmlclip.gif" width="130" height="101">