Explaining the HTML ELEMENTS.
An HTML element is defined by a start tag, some content, and an end tag.
The start tag and the end tag together make up the HTML element.
<tagname>Content goes here...</tagname>
Examples of some HTML elements:
<h1>My First Heading</h1>
<p>My first paragraph.</p>
<br>None <?>
What is br element?
The line break element, or <br> A line break (carriage-return) is produced in text by the HTML element br. It is helpful when composing a poem or an address when the line breaks matter.
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 (<html>, <body>, <h1> and <p>):
<!DOCTYPE html>
<html>
<body>
<h3>Example for Nested Elements</h3>
<p>This is <em>Emphasize</em> Text</p>
<p>This is <b>bold</b> text</p>
</body>
</html>
What is em element?
The <em> tag is used to define emphasized text. The content inside is typically displayed in italic. A screen reader will pronounce the words in <em> with an emphasis, using verbal stress.
What is b element?
The Bring Attention To element. The <b> HTML element is used to draw the reader's attention to the element's contents, which are not otherwise granted special importance. This was formerly known as the Boldface element, and most browsers still draw the text in boldface.
EXAMPLE EXPLAINED:
The <html> element is the root element and it defines the whole HTML document.
It has a start tag <html> and an end tag </html>.
Then, inside the <html> element there is a <body> element:
EXAMPLE:
<body>
<h3>Example for Nested Elements</h3>
<p>This is <em>Emphasize</em> Text</p>
<p>This is <b>bold</b> text</p>
</body>
The <body> element defines the document's body.
It has a start tag <body> and an end tag </body>.
Then, inside the <body> element there are four other elements: <h3>, <em>, <p> and <b>:
EXAMPLE:
<h3>Example for Nested Elements</h3>
<p>This is <em>Emphasize</em> Text</p>
<p>This is <b>bold</b> text</p>
The <h3> element defines a heading.
It has a start tag <h3> and an end tag </h3>:
The <p> element defines a paragraph.
It has a start tag <p> and an end tag </p>:
The <em> element defines a Emphasize.
It has a start tag <em> and an end tag </em>:
The <b> element defines a bold.
It has a start tag <b> and an end tag </b>:
Some HTML elements will display correctly, even if you forget the end tag:
EXAMPLE:
<!DOCTYPE html>
<html>
<body>
<p>This is a paragraph.
<p>This is a paragraph.
</body>
</html>