- As it has already been mentioned before, HTML element is the content between start tag and end tag: <p>This is a text</p>. Starting tag - <p>, element content – “this is a text”, closing tag - </p>. Nested HTML elements stand for elements that contain other HTML elements.
- There are important HTML syntax rules that should be remembered for quick and easy start with HTML:
-
- every HTML element starts with start/opening tag
- every HTML element ends with end/closing tag
- element content is the content enclosed in start and end tags
- certain HTML elements may contain an empty content
- empty elements are closed in an opening tag
- HTML elements may be supplied with HTML attributes
- Example of HTML text:
- Example description:
- <html> element – defines the start and the end of the HTML document. Closing element tag is </html>, which marks the end of the document.
- <body> - marks the start of the body part of the HTML document. Closing element tag is </body>. May contain other elements, such as <p>, which stands for paragraph.
- *Important note: it is necessary to remember about the end tag. Most browsers will read HTML code correctly even without end tag:
- <p>This is a text
- However, in certain cases missing end tag may produce errors, so better not skip end tags.
- Empty HTML elements are elements that do not contain any content. Empty elements may be enclosed in start tag only. For instance, <br> is an empty element, which defines a line break and it doesn’t have an end tag. However, future versions of HTML, XHTML and XML do not allow HTML elements that are not closed. Correct closing of <br> element will be adding slash - <br />, and in this case it will be accepted by HTML, XHTML and XML. Thus, closing empty tags correctly makes the webpage future-proof.
- *Important note: it is better to use lowercase for HTML tags. Generally, tags are not case sensitive, and <S> will mean exactly the same as <s>. However, the World Wide Web Consortium recommends using lowercase, and for future versions of HTML/XTML upper case is not acceptable.
-
- HTML Get Started
- HTML Basic
- HTML attributes
- HTML headings


