![](100transp.gif) |
SUMMARY OF HTML TAGS
TAG |
PAIRED? |
USE, DETAILS ETC. |
HTML |
YES |
First (and last) tag on a page |
HEAD |
YES |
Encloses title details, meta tags etc; separate from body of page and will not appear on page when viewed. |
TITLE |
YES |
Enclosed within HEAD tags – displays at top of browser window. |
BODY |
YES |
Encloses whole of page – text, images etc. Body ATTRIBUTES include background image (BACKGROUND=), background colour (BGCOLOR=) text colour (TEXT=), link colour (LINK=) and visited link colour (VLINK=). |
META |
NO |
Used by search engines – attributes include NAME= (keywords and description) and CONTENT= (list of keywords and details of content etc.) of your website. |
IMG |
NO |
Displays images – gif or jpg format – attributes include source (SRC=) alternate text description (ALT=), image height (HEIGHT=), width (WIDTH=) and border (BORDER=) in pixels, and alignment (ALIGN=) left, right or center. |
FONT |
YES |
Default FONT is Times Roman, size 3 – to display any other font needs the attributes typeface (FACE=) and font size (SIZE=), where 1 is the smallest and 7 the biggest. Note : if choosing an unusual font, also give some commoner alternatives, separated by commas. |
B |
YES |
Bold – displays text within these tags in bold typeface. |
I |
YES |
Italic – displays text within these tags in Italics. |
U |
YES |
Underlines all text within these tags. |
BR |
NO |
Line break – same as the “return” key when word-processing or typing. |
HR |
NO |
Horizontal rule. Default is a thin grey line right across the page; vary the width as a percentage of the page width. Centres automatically - any text, data etc. after the HR tag will need its alignment re-setting if it is not to be centred |
CENTER |
YES |
Centres all text, images, tables etc. within the tags. |
P |
NO |
Paragraph break tag – add attribute to align (ALIGN=) text to LEFT, RIGHT, CENTER or JUSTIFY (distribute text evenly along line.) NB. These attributes do not always display correctly on Netscape bowsers. |
TABLE |
YES |
Sets table on page. Attributes include the overall width of the table (WIDTH=), which can be set as a percentage or in actual pixel width; width of border (BORDER=) in pixels – BORDER=”0” will produce an “invisible” table; border colour (BORDERCOLOR=), background colour (BGCOLOR=) and image (BACKGROUND=) – not supported by all browsers. |
TH |
YES |
Table Header: not an essential tag – you can get the same effect by making your first row span the width of the table. |
TR |
YES |
Table Row – encloses all the data cells on one row of a table. |
TD |
YES |
Table Data cell : can contain text or images, with appropriate tags. Attributes include the width (WIDTH=) and/or height (HEIGHT=) of the cell in pixels; TD WIDTH= can also be expressed as a percentage of the width of the whole table. To align data horizontally use the align attribute (ALIGN=) left, right or center, and to align vertically use the vertical alignment attribute (VALIGN=) top, bottom or middle. To make a data cell span more than one row or column, use the COLSPAN= and/or the ROWSPAN= tags, where the quantity specified is the number of actual rows or columns to be spanned by the data cell. To justify text within a data cell, use the <P ALIGN=”JUSTIFY”> tag. |
The "&" command |
In order to display HTML tags on your web page you need to use the & commands when writing your HTML. The commonest ones are shown below (note: all these start with a & (ampersand) and finish with a ; (semicolon). |
& copy ; ©
& gt ; > & lt ; < |
As an example, to make the phrase “the HTML tag is written as <HTML></HTML>” show up on the webpage it needs to be typed in as “The HTML tag is written as & lt ; HTML & gt ; & lt ; /HTML & gt ; ” (minus the spaces) and similarly © D.Davies is typed in as “& copy ; D.Davies". |
Data added to attributes in tags needs to be typed within quotation marks (“ ”) and hexadecimal codes need to be preceded by the hache (#) sign to ensure correct display on all browsers : e.g. <BODY BACKGROUND=“pinkspots.jpg” BGCOLOR= “#0000ff”> |
All HTML tags need to be nested, that is, closed in the reverse order to that in which they were opened. You must not overlap tags otherwise your page will not display correctly.
e.g. <HTML><HEAD><TITLE> </TITLE></HEAD><BODY> </BODY></HTML> |
HTML help index
Home page and main index
|