Tags and HTML-elements

HTML uses HTML-elements, which are either text enclosed by tags or tags themselves. A tag is a word or letter, enclosed in "<" and ">". Examples of tags are <P> or <CENTER> or <H2> or <TABLE>. If tags enclose text, the word or letter of the closing tag is preceded by a slash, like in </P> or </CENTER> or </H2> or </TABLE> for the four examples above. There are also a few standalone tags, like <BR> ( a simple line break) or <HR> ( a horizontal ruler).

Here is a list of some commonly used tags and their meaning:

Line breaks and empty lines do not have any meaning in your HTML file. They are ignored by your browser, but you can use these features for better readability of the source code. Also, the tags are not case-sensitive.


Tags can also contain additional specifications. Only the first tag of a tag pair or standalone tags may contain these so-called attributes. The attribute is either a single key word (like in NOSHADE) or key word, equal sign, and number or name in quotation marks (like in ALIGN="right" or in WIDTH="100" or in SOURCE="Picture.gif" or in CLASS="tag"

Almost every HTML-element can have the attribute TITLE="...". The title would be shown in a small yellow box if you move the mouse over the element in the browser, see the example in this paragraph.

Here is how a horizontal ruler with attribute <HR WIDTH="200"> would be displayed by the browser:

And here is a red horizontal line with source code <HR CLASS="tag">

Full page view