HTML 5
HTML 5
HTML Documents
All HTML documents must start with a document type declaration: <!DOCTYPE html>.
The HTML document itself begins with <html> and ends with </html>.
The visible part of the HTML document is between <body> and </body>.
HTML Headings
HTML Paragraphs
HTML paragraphs are defined with the <p> tag:
HTML Links
HTML Images
HTML images are defined with the <img> tag.
The source file (src), alternative text (alt), width, and height are provided as
attributes:
1
HTML Elements
An HTML element usually consists of a start tag and end tag, with the content inserted in
between:
HTML elements with no content are called empty elements. Empty elements do not have
an end tag, such as the <br> element (which indicates a line break).
HTML Attributes
2
The title Attribute
Here, a title attribute is added to the <p> element. The value of the title attribute will be
displayed as a tooltip when you mouse over the paragraph:
<p title="I'm a tooltip">
Attribute Description
alt Specifies an alternative text for an image, when the image cannot be
displayed
disabled Specifies that an input element should be disabled
HTML Headings
Tag Description
<html> Defines the root of an HTML document
<body> Defines the document's body
<head> A container for all the head elements (title, scripts, styles, meta
information, and more)
<h1> to Defines HTML headings
<h6>
<hr> Defines a thematic change in the content