Learn the elements in HTML

Learn the elements in HTML

In the previous article, Taimienphi.vn introduced you to the attributes in HTML, in the next article below, Taimienphi.vn will introduce you the elements in HTML.

The following article Taimienphi.vn will introduce to you element in HTML, in addition readers can refer to some other articles on Taimienphi.vn to learn what HTML is.

Learn the elements in HTML

Table of Contents:
1. Elements in HTML
1.1. Nested HTML element
1.2. End tag in HTML
1.3. Empty element in HTML
1.4. HTML is not case sensitive

1. Elements in HTML

In HTML, the element usually consists of a start tag and an end tag, with the content inserted in the middle.

HTML elements are any content within the start tag to the end tag.

For example: text in html

text in html 2

HTML elements without content are called empty elements. Empty elements have no end tag, such as the br element.

1.1 Nested HTML element

Elements in HTML may be nested, that is, the element may contain other elements.

All HTML documents contain nested HTML elements.

For example, in the example below illustrates 4 nested HTML elements:

text in html 3

The result after using the nested HTML element has the following form:

text in html 4

In the example above:

Element html The whole document definition.

– Has a start card html and an end tag html.

– In the html element is the body element or in other words the body element is nested within the html element.

text in html 5

The body element identifies the body of the document.

– There is a start body tag and an end body tag.

– 2 HTML elements are nested within body elements: h1 and p.

text in html 6

The h1 element defines the heading.

– There is an h1 start card and an h1 end card.

– The content element is Taimienphi.vn. In the above example, h1Taimienphi.vn h1.

The p element identifies the paragraph.

– Include a start p and an end p tag.

– The content element is: Hoc HTML on Taimienphi.vn. In the above example is

text in html 7

1.2 The end tag in HTML

Some HTML elements may display correctly even if we forget to use the end tag.

Example 1:

text in html 8

In the above example, even if there is no end tag, the result will still display exactly as shown below:

text in html 9

Note: However, HTML elements do not always display correctly, so Taimienphi.vn recommends using the end tag.

1.3 Empty element in HTML

HTML elements without content are called empty elements.

br is an empty element because there is no closing tag. The br tag in HTML is used to insert line breaks.

For example:

text in html 10

The results returned after using the br tag looks like the following:

text in html 11

Blank elements can be placed in an opening tag such as br /.

1.4 HTML is not case sensitive

HTML tags are not case sensitive, so we can use either P or p.

The article above Taimienphi.vn has just introduced you to the elements in HTML. Also if there are any questions or questions that need answers as set File path in HTML How ?, Readers can leave their comments in the comment section below the article.


Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *