HTML5 Elements and Basic grammar

Source: Internet
Author: User
Tags closing tag

HTML tags
Start tag (opening tag): Open tag
End tag (closing tag): Closed label


Elements
Definition: HTML element refers to the code from the start tag to the end tag (the element starts with the start tag and terminates with the sleepover tag)
Element content: The content of an element refers to the content between the start tag and the end tag

element features:

2,html document has nested HTML elements that make up
3, do not forget to end the tag, future HTML version does not allow to omit the end tag
4, empty HTML element
5, HTML elements that have no content are called empty content of elements, and empty elements are
The difference between empty elements and empty content: The start and end tags of an empty element are the same, paying attention to the label. Empty content refers to content within an element that is empty and focused on content.

HTML BASIC structure
<!doctype Html>: Not a label, just used to declare help browser correctly realistic Web page

The <meta> tag is always in the head element, and the tag provides metadata about the HTML document
<style> tags for defining style information for HTML documents
<title></title> define the title of the document
The text between <body></body> is the content of Web courseware
Text description page between

HTML properties
HTML tags can have properties, and properties provide more information about HTML elements
Property always appears as a name/value pair
Property values should always be enclosed in parentheses, and double quotes are the most common, but using single quotes is no problem

HTML annotations
You can insert comments in your code to improve the readability of your code, and comments are not displayed on the page, and the browser ignores them
Format:<!--This is a comment-->

1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <MetaCharSet= "Utf-8">5 <title>Untitled Document</title>6 <style>7 8 #box1{9 Background-color:Red;Ten } One . Div1{background:Yellow;} A . Div2{Border:1px solid #000;} -  - </style> the </Head> -  - <Body> -  + <!--the ID can only be unique - - <Divstyle= "width:100px; height:100px; border:1px solid #000;"ID= "Box1 box2"></Div> +   A  at <!--The class can be multiple - - <Divstyle= "width:100px; height:100px;"class= "Div1 div2" ></Div> -  - <!--The class can be multiple - -  - <ahref="#"title= "I am a hint message">I am a link</a> in  - </Body> to </HTML>

HTML5 Elements and Basic grammar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.