Which tags are used in HTML

(X) HTML tags and attributes

Preliminary remarks

The following lists contain tags that can be used in HTML as in XHTML between "" and "". In the (older) HTML there are somewhat less strict rules than in the (current) XHTML. It therefore makes sense to adhere to the stricter rules right from the start.

Tags are used to describe the logical structure of an HTML document. Additional attributes (properties) of a page element can be linked to a tag, e.g. to format or position a page element. Other types of information can also be linked to a tag, e.g. a name that uniquely identifies the page element.

We differentiate between tags for block elements and those for integrated elements. Most tags come in pairs: an opening tag such as comes before a page element, and a corresponding closing tag comes after this page element. However, some tags stand alone, e.g. the one that forces a line break: . Since in XHTMLall

Tags have to be closed, these individual tags have a formal end: a space followed by a "/" is appended to them, e.g.
noted. The following lists are not exhaustive.

Tags do not contain capital letters (this is required in XHTML).

Tag for commentsDay
<!-- (Kommentartext) -->description

for single and multi-line comments

Tags for block elements

Block elements (block-level elements) always start in a new line and so do subsequent elements. Day
<h1> ... </h1>description
<p> ... </p>1st order heading; analog to
<ol> ... </ol>Paragraph of text
<ol> ... </ol>(unordered) bulleted list
<li> ... </li>numbered list; If the numbering type is not specified using the type attribute, a bulleted list is displayed (list formatting using CSS is more elegant and flexible)
<table> ... </table>List item
<tr> ... </tr>Table; if a frame is to be displayed, the attribute can be added (this is more elegant with CSS); each table consists of individual lines:
<th> ... </th>Table row; each row consists of individual cells:
<td> ... </td>Table cell with a column heading (only useful at the beginning of the table)
<div> ... </div>Table cell with data; the cells of a table correspond to the paragraphs of a text and are therefore block elements

generic block element; serves as a container for elements of different types; plays a key role in CSS

Tags for embedded elements

Inline elements do not create new lines and are in the normal flow of text. As a rule, they must not contain any block elements (important exception: ). Day
<em> ... </em>description
<strong> ... </strong>stressed; is italicized by default, unless otherwise specified
<a> ... </a >heavy emphasis; is set to bold by default, unless otherwise specified
<span> ... </span>is used with the href attribute and is used to define a reference; in XHTML the target attribute should be abolished (this attribute can be used to control where the browser should open the reference target)
<br> bzw. <br />generic inline element; can be used both within blocks and as a container for several blocks; plays a key role in CSS
<img> bzw. <img />forces a line break, but does not end the paragraph

includes a graphic; must be connected to the src attribute; A verbal description should always be added using the alt attribute (required in the guidelines for accessible web)

Attributes that can be linked to tags

Attributes (properties) such as id (to define a unique name) are additional information about a tag and are always in an opening or in a stand-alone tag after the actual tag name. An attribute also has a value that is assigned to the attribute (in XHTML, the specification of a value is mandatory, whereby the name of the attribute itself can be used as the default value). - Create a numbered list in phase 5 (activate the "Lists" tab and select one of the numbered lists). What do you think these attributes do? (Try out!)

In (X) HTML, values ​​should always be quoted between quotation marks (in XHTML always, in HTML at least if the name of the value contains spaces), and there should be no spaces between attribute, equal sign and value. - Note: In CSS files, the relevant information is in quotation marks exactly when it contains spaces.

The following overview only lists those HTML attributes that make sense when using CSS: the many attributes for formatting and positioning an element are not needed when using style definitions.attributepossible values
descriptionsrcAddress of a source file
integrates sources and is used especially in connection with the tag; the addresses can be given absolutely or relatively, e.g. or ; the directory immediately above is addressed with two dots (".."); Note: in HTML path information, directories are separated by "/" (also on Windows systems!)old descriptive text
should be used in the tag; informs a visitor to the site who has switched off the display of images or cannot recognize images, e.g. due to a visual impairmenthrefTarget of the cross-reference
is used in the tag to specify the target of the link; this can be within the same file (eg href = "# anfang", where "#start" must be defined as the ID of a page element) or outside (eg href = "http://www.inf.fu-berlin.de" or href = "http://www.inf.fu-berlin.de/Bebeispielverzeichnis/beispiel.html#anfang"); "id" is used for page elements that can only appear once on a page; the directory immediately above is addressed with two dots (".."); Note: in HTML path information, directories are separated by "/" (also on Windows systems!)idunique name of a page element
is used to identify page elements, to refer to them using href or to assign them a certain style; Example:
; the similarly functioning attribute "name" no longer exists in XHTML
className of a class in a style definition