HTML 5 Programming and Web development/HTML 5 Elements

HTML Tags
In HTML, tags are used to create elements of a web page. Examples of elements are paragraphs and headings. Tags are surrounded by angle brackets, like this: &lt;tag&gt; An example of an HTML 5 tag is h1.This tag creates a heading element and it is written like this. h1 is the highest-level heading in HTML. Think of it like a headline for a news story. There are two types of tags. The first, like you've seen here, starts with and ends with. These markers show where the heading begins and ends. In the same way, a paragraph is marked at the beginning with  and at the end with. The second type of tag is self-closing; that is, it does not have a second tag marking its end.

Some examples of self-closing tags are  (line break),   (horizontal rule), (element that accepts user input), and (an element that contains information about the web page itself).

While the ending slash (/) on a self-closing tag is optional, it is considered a best practice to include them.

HTML Elements
An HTML element is an object in a web page. Some examples are images, paragraphs, headings, and videos. They start with a start tag and end with an end tag. HTML 5 has different kinds of elements that we will learn about throughout this course.

How to write an HTML Element
To write an HTML Element we first write the start tags. Then we write the content of the element: .Then we write the end tag. . When you put it together you have an HTML element.

Nested Elements
The content of an HTML element can be another element. This is called "nesting". For example: Note: New line characters are ignored in HTML 5. This code would actually render like this: To achieve multi-line we actually use the line break tag.

List of HTML 5 Elements
Note this is just a short list of elements:

Example of a well formed HTML document
The  is not an HTML tag, so it has no closing tag or terminating slash. It is a Document Type Definition which we will learn about subsequently.