My First Heading
My first paragraph.
Start tag Element content End tagMy First Heading
My first paragraph.
none none Note: Some HTML elements have no content (like the
element). These elements are called empty elements. Empty elements do not have an end tag! Nested HTML Elements HTML elements can be nested (this means that elements can contain other elements). All HTML documents consist of nested HTML elements. The following example contains four HTML elements (, ,
and
): Example
My First Heading
My first paragraph.
Example Explained The element is the root element and it defines the whole HTML document. It has a start tag and an end tag . Then, inside the element there is a element:My First Heading
My first paragraph.
The element defines the document's body. It has a start tag and an end tag . Then, inside the element there are two other elements:and
:
My First Heading
My first paragraph.
The element defines a heading.
It has a start tag and an end tag
:
My First Heading
The
element defines a paragraph. It has a start tag
and an end tag
:My first paragraph.
Never Skip the End Tag Some HTML elements will display correctly, even if you forget the end tag: ExampleThis is a paragraph
This is a paragraph
However, never rely on this! Unexpected results and errors may occur if you forget the end tag!
Empty HTML Elements
HTML elements with no content are called empty elements.
The
tag defines a line break, and is an empty element without a closing tag:
Example
This is a
paragraph with a line break.
means the same as
. The HTML standard does not require lowercase tags, but W3C recommends lowercase in HTML, and demands lowercase for stricter document types like XHTML. At W3Schools we always use lowercase tag names. HTML Tag Reference W3Schools' tag reference contains additional information about these tags and their attributes. Tag Description Defines the root of an HTML document
Defines the document's body
No comments:
Post a Comment