HTML Tag Elements
What is a Tag? and know about HTML Tags.
In this HTML chapter you will learn about HTML elements. HTML documents are composed of elements. Each element starts with a start tag, followed by the element's content and ends with a end tag.
- Some HTML elements do not have a end tag or content.
- HTML elements are not case sensitive but it is advised that you should use lower-case for HTML elements.
- HTML elements can be nested to create a structure document.
- If you forget to close the end tags, it may work in most of the modern web browsers. As a best practice, this behavior should not be relied upon.
The general HTML element format is,
<tag>content</tag>
Following is an example of a paragraph element:
<p>This is a HTML Paragraph.</p>
Example of an empty HTML element which inserts a line break in the HTML document flow. HTML5 does not require to add a slash at the end to tag descriptor.
<br>
HTML Elements
Following is a set of HTML tag elements that are frequently used. We will see about the complete set in the coming chapters.
<p> HTML Paragraph content. </p>
<h1> HTML Heading One </h1>
<h2> HTML Heading Two </h2>
<b> Bold Style Element </b>
<u> Underline Style Element </u>
<i> Italic Style Element </i>
<code> Code snippet </code>
Empty HTML Elements:
<br> - HTML break introduces a new line in the HTML document.
<hr> - Adds a horizontal line.
HTML Meta Elements:
<title> HTML Web Page Title </title>
<link rel="stylesheet" type="text/css" href="style.css" >
HTML Example Web Page
<!DOCTYPE html>
<html>
<head>
<title>An Example Web Page</title>
</head>
<body>
<h1>Example HTML</h1>
<p>This is an example HTML web page.</p>
<hr>
<p>This is the <b>second</b> paragraph.</p>
</body>
</html>