Beruflich Dokumente
Kultur Dokumente
HTML Elements
HTML elements are written with a start tag, with an end tag, with the content in between:
<tagname>content</tagname>
The HTML element is everything from the start tag to the end tag:
Start tag
Element content
End tag
<h1>
My First Heading
</h1>
<p>
My first paragraph.
</p>
<br>
Example
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Example
<html>
<body>
<p>This is a paragraph
<p>This is a paragraph
</body>
</html>
The example above works in all browsers, because the closing tag is considered optional.
Never rely on this. It might produce unexpected results and/or errors if you forget the end
tag.
Basic elements
Basic elements are the backbone of any HTML document. You'll see these elements in the source code for all web
pages after the doctype declaration on the first line of the page. The doctype specifies which version of (X)HTML
that page is using. Page elements are placed between the opening <html> and closing </html> tags, also called the
root element.
Elemen
t
<html>
Description
The HTML root element (<html>) represents the root of an HTML document. All other elements must
be descendants of this element
Document metadata
Metadata contains information about the page. This includes information about styles, scripts and data to help
software (Search engines, browsers, etc.) use and render the page. Metadata for styles and scripts may be defined
in the page or link to another file that has the information.
Elemen
t
<base>
Description
The HTML Base Element (<base>) specifies the base URL to use for all relative URLs contained within
a document.There is maximum one <base> element in a document.
<head> The HTML Head Element (<head>) provides general information (metadata) about the document,
including its title and links to or definitions of scripts and style sheets
<link>
The HTML Link Element (<link>) specifies relationships between the current document and an external
resource. Possible uses for this element include defining a relational framework for navigation. This
Element is most used to link to style sheets.
<meta
The HTML Meta Element (<meta>) represents any metadata information that cannot be represented
Elemen
t
Description
>
by one of the other HTML meta-related elements (<base>, <link>, <script>, <style> or <title>).
<style>
The HTML <style> element contains style information for a document, or a part of document. The
specific style information is contained inside of this element, usually in the CSS.
<title>
The HTML <title> element (HTML Title Element) defines the title of the document, shown in a
browser's title bar or on the page's tab. It can only contain text and any contained tags are not
interpreted.