Posts in current category
May 02, 2021 11:06 HTML
HTML documents are defined by HTML elements, which refer to all code from the start tag to the end tag.
|Start Tags||The contents of the element||End Tags|
|<p>||This is a paragraph||</p>|
|<a href="default.htm">||This is a link||</a>|
|<br>||This is a line-by-line label|
* The start label is often referred to as the start tag, and the end label is often referred to as the closed tag.
Note: You'll learn more about properties in the HTML Properties chapter of this tutorial.
HTML documents consist of nested HTML elements that can contain other HTML elements.
The above example contains three HTML elements.
This element defines a paragraph in an HTML document.
This element has a start label, and an end label, slt;/p.gt;
The element content is: This is the first paragraph.
Open the field test to start learning the tab.
The element defines the body of the HTML document.
This element has a start label, slt; body, and an end label, slt;/body.
The element content is another HTML element (p element).
The element defines the entire HTML document.
This element has a start tag , and an end tag , and an end tag , .
The element content is another HTML element (body element).
If you forget to use the end tag, most browsers will also display HTML correctly:
The above examples can also be displayed in the browser because closing the tab is optional.
However, you cannot rely on this because forgetting to use the end label can produce unpredictable results or errors.
An HTML empty element is an HTML element without content.
HTML empty elements should be closed in the Start label.
An empty element of HTML is slt;br?gt;(used to define line-ups), and the element is that there is no label off.
The closing method for HTML empty elements is to add slashes to the start label, such as slt;br /;, which is accepted by HTML, XHTML, and XML.
Note: In XHTML, XML, and future versions of HTML, all elements must be turned off, even empty elements.
Because HTML tags are not sensitive to the case of English letters, they mean the same thing, although most websites prefer to use capital HTML tags.
W3CSchool uses a small-case label because the World Wide Web Federation (W3C) recommends using small verses in HTML 4 and enforces them in future (X) HTML versions.