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
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.
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:
The result after using the nested HTML element has the following form:
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.
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.
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
1.2 The end tag in HTML
Some HTML elements may display correctly even if we forget to use the end tag.
In the above example, even if there is no end tag, the result will still display exactly as shown below:
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.
The results returned after using the br tag looks like the following:
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.