HTML cheat sheet for campaigners
</confusion> with this summary of all the html formatting basics you're likely to need!
Using HTML for basic formatting isn't too hard, and with some practice you'll get the knack quickly.
The most important this to remember is that you put tags on either side of every piece of text you want to be formatted in a particular way - <> marks the beginning and </> marks the end of the tag.
If you've run into some problems with your formatting, the first thing to check for is whether you forgot to close a particular tag.
Here's a useful cheat sheet to have to hand when using HTML to format text. If you think we're missing some obvious pieces, let us know in the comments!
FORMATTING
LISTS
Numerical (ordered list) | start/end list <ol> </ol> each list item <li> </li> |
<ol> <li> This is a bullet point </li> <li> this is the next point </li> </ol> will look like this:
|
Bullet (unordered list) | start/end list <ul> </ul> each list item <li> </li> |
<ul> <li> This is a bullet point </li> <li> this is the next point </li> </ul> will look like this:
|
TABLES
Open/Close a Table | <table> </table> | |
Table Row | <tr> </tr> | |
Table Cell | <td> </td> | |
Cell/Row HORIZONTAL Alignment | cell: <td align=”left/right/center”> </td> row (specifies alignment of content for all cells in the row): <tr aign=”left/right/center”> </tr> |
<td align=”left”> (…) </td> eg. left text alignment <td align=”right”> (…) </td> eg. right text alignment <td align=”center”> (…) </td> eg. centred text alignment |
Cell/Row VERTICAL Alignment | cell: <td valign=”top/middle/bottom”> </td> row (specifies alignment of content for all cells in the row): <tr valign=”top/middle/bottom”> </td> |
<td valign=”bottom”> (…) </td>
eg. of text vertically aligned to the bottom of a cell |
Specify Column Span i.e. to create the effect of merging cells across columns |
<td colspan=”number-of-columns”> </td> NB: default is 0 |
|
Specify Row Span i.e. to create the effect of merging cell rows |
<tr rowspan=”number-of-rows”> </tr> NB: default is 0 |
|
Stop Text Wrap in a Cell | <td nowrap> </td> i.e. prevents the lines within a cell from being broken to fit |
LINKS
Hyperlink | <a href=” “> </a> | regular, showing url <a href =”link”></a> eg. www.gotothiswebsite.com using specified text <a href=”link”>(…)</a> eg. sign the petition here |
Mailto Link | <a href=”mailto:SPECIFYEMAIL”> </a> | <a href =”mailto:email@something.com”></a> |
Mailto Link WITH Specified Subject Line | <a href=”mailto:SPECIFYEMAIL?subject=”> </a> | <a href=”mailto:email@something.com?subject=(…)”> </a> |
Image Link | <a href=”link”><img src=”image url”></a> | |
Link to Download a File via a Thumbnail Image Link | <a href=”FILE LINK”><img src=”IMAGE LINK” width=”WIDTH”></a> | |
Open Link in a New Window | <a href=”link” target=”_blank”>(…)</a> |
EXAMPLE HTML
Hi friends, <br><br> This is an example of <b> html coding </b>. <br> It’s important for:
<ul><li> Emails </li>
<li> pages </li>
<li> modules </li> <li><i>etc etc</i> </li></ul> Google some cool coding <a href="http://www.google.com">here<a/>.
RESULT:
Hi friends,
This is an example of html coding .
It’s important for:
- Emails
- pages
- modules
- etc etc
COLOURS
<font color=”#FF000”> </font>
If you would like to add colours (other than black), that is more challenging.
There are 16.7 mi. different colours, each colours consists of 3 parts (the hexadecimal value): the red value, blue value and green value, which are indicated by two letters/ numbers each.
The codes for the basic colours are for example:
Red: #FF0000
Blue: #0000FF
Green: #00FF00
More codes can be found here: http://html-color-codes.info/
There are currently no comments.