23 Jun 2016

HTML Elements


HTML elements are written with a start tag, with an end tag, with the content in between:

content
The HTML element is everything from the start tag to the end tag:

Nested HTML Elements:

  • HTML elements can be nested (elements can contain elements).
  • All HTML documents consist of nested HTML elements.


This example contains HTML elements:

Example:

My First Heading

My first paragraph.

HTML Example Explained:

  • The element defines the whole document.
  • It has a start tag and an end tag .
  • The element content is another HTML element (the element).
  • Don't Forget the End Tag
  • Never rely on this. It might produce unexpected results and/or errors if you forget the end tag.


Empty HTML Elements:

  • HTML elements with no content are called empty elements.

  • is an empty element without a closing tag (the
    tag defines a line break).
  • Empty elements can be "closed" in the opening tag like this:
    .
  • HTML5 does not require empty elements to be closed. But if you want stricter validation, or you need to make your document readable by XML parsers, you should close all HTML elements.
  • HTML tags are not case sensitive: means the same as .

Share this

0 Comment to "HTML Elements"

Post a Comment