HTML5 Elements and Basic grammar
HTML tag start tag (opening tag): Open tag end tag (closing tag): Closed tag
Element definition: The HTML element refers to the code from the start tag to the end tag (the element terminates with the start tag as the starting label) element: The content of the element refers to the content between the start tag and the end tag
element features: 2,html document has nested HTML elements 3, do not forget to end the tag, the future HTML version does not allow to omit the end tag 4, empty HTML element 5, the HTML element without content is called the empty content of the element, the empty element is closed in the start tag note:
HTML basic structure <!doctype Html>: Is not a label, just to declare help browser correctly realistic page <meta > tags are always in the head element, and tags provide metadata about HTML documents <style> tags for defining style information for HTML documents <title></title> defining the title of a document The text between <body></body> is the content of the Web courseware
HTML attributes HTML tags can have properties, properties provide more information about HTML elements properties always appear as name/value pairs the property values should always be enclosed in parentheses, and double quotes are the most common, but using single quotes is no problem
HTML annotations can be inserted into the code to improve the readability of the code, the comments will not appear in the page, the browser will ignore their format:<!--This is a comment-->
1<!DOCTYPE HTML>2<Html>3<Head>4<MetaCharSet= "Utf-8">5<Title> Untitled Document</Title>6<Style>78#box1{9Background-color:Red;10}11. div1{Background:Yellow;}12. div2{Border:1px solid #000;}1314</Style>15</Head>1617<Body>1819<!--The ID can only be unique-20<DivStyle= "width:100px; height:100px; border:1px solid #000; "Id= "Box1 Box2"></Div>21st2223<!--The class can be multiple-24<DivStyle= "width:100px; height:100px; "Class= "Div1 Div2"></Div>2526<!--class can be multiple- - <a href= "#" title= "I am a hint message"> I am a link </a> </body> </html>
HTML5 Elements and Basic grammar