Html5 elements and basic syntax, basic syntax of Html5 Elements
HTML Tag
Opening tag: Open tag
Closed tag
Element
Definition: HTML elements refer to the code from the start tag to the end tag (elements start with the start tag and end with the default tag)
Element Content: The content of an element refers to the content between the start tag and the end tag.
Features:
1. Most HTML elements can be nested (including other HTML elements)
2. HTML documents are composed of Nested HTML elements.
3. Do not forget the end tag. The end tag cannot be omitted in future HTML versions.
4. Empty html elements
5. the html element without content is called the empty content of the element. The empty element is disabled in the start tag.
Note:
The difference between empty elements and empty content: the start and end labels of empty elements are the same, and the focus is on labels. Empty content indicates that the content in the element is empty and focuses on the content.
Basic HTML Structure
<! Doctype html>
<Head> <Meta> the tag is always in the head element. The TAG provides metadata about the HTML document.
<Style> tags are used to define style information for HTML documents.
<Title> </title> define the document title
The text between <body> </body> is the content of the webpage courseware.
<Html>
HTML attributes
Html tags can have attributes, which provide more information about html elements.
Attribute always appears in the form of name/value pair
Attribute values should always be included in brackets. Double quotation marks are the most common, but they are no problem with single quotation marks.
HTML comment
You can insert comments in the code to improve code readability. The comments are not displayed on the page and will be ignored by the browser.
Format: <! -- This is a comment -->
1 <! Doctype html> 2