1.HTML5 new Features
(1) Concise doctype:
HTML5 There is only one simple document type: <! DOCTYPE Html>, indicates that the browser will parse in standard mode.
(2) Simple and easy to remember encoding type
You can now use "charset" in the META tag: <meta charset= "utf-8″/>
(3) scripts and links do not require type
<link rel= "stylesheet" href= "Path/to/stylesheet.css"/>
<script src= "Path/to/script.js" ></script>
(4) More Semantic new tags
such as:<article>, <section>, <aside>,
(5) Video and audio
<video width= "640" height= "0.jpg" preload= "Auto" poster= "controls>"
<source src= "Movie.ogg" type= "Video/ogg"/>
<source src= "Movie.mp4" type= "Video/mp4"/>
Your Browser does not support the video tag.
</video>
(6) Table Shankiang
- New input types: color, email, date, month, week, Time, DateTime, Datetime-local, Number,range,search, tel, and URL
- New properties: required, autofocus, pattern, list, AutoComplete and placeholder
- New elements: <keygen>, <datalist>, <output>, <meter> and <progress>
(7) Canvas label Drawing 2D Graphics
var canvas = document.getElementById (' canvas ');
var context = Canvas.getcontext (' 2d '); Context.beginpath (); Context.moveto (100,100); Context.lineto (300,300); Context.lineto (100,500); context.linewidth = 5;context.strokestyle = "Red"; Context.stroke ();
(8) Location access
2.HTML semantics
(1) What is HTML semantics?
The content semantics are judged by tags, for example, according to the H1 tag, the content is the title, according to the content is paragraph, <input> tag is the input box.
(2) Why semantic?
1). Make the page appear clearly structured when removed or lost in style
2). Facilitate other device parsing (such as screen readers, blind readers, mobile devices) to render web pages in a meaningful way
3). SEO Friendly
4). Easy to team development and maintenance, follow the standard, can reduce the difference
(3) How do you determine if your tags are semantically sound?
Remove the style and see if the structure of the Web page is well organized and is still very readable.
(4) Common semantic tagging module
Form
<form action= "" method= "" >
<fieldset>
<legend> Login Form </legend>
<label for= "name" > account:</label>
<input type= "text" id= "name" >
<label for= "PW" > Password:</label>
<input type= "password" id= "PW" >
<input type= "Submit" name= "Login" class= "SUBBTN" >
</fieldset>
</form>
form fields are wrapped with fieldset tags, and the use of the legend label describes the purpose of the form; the description text for each input tag needs to use a label label and is set in the Lable tab by setting the ID property for input for= Someld to associate the explanatory text with the corresponding input.
(5) Some problems should be paid attention to in semantic labeling
- Use as few semantic-free tag div and span as possible;
- When the semantics is not obvious, can use Div or P, as far as possible with P, because p in the default case has up and down spacing, to compatible with the special terminal is advantageous;
- Do not use a plain style label, such as: B, Font, u, etc., instead of using CSS settings.
- Text that needs to be emphasized, can be contained in strong or EM tags, strong default style is bold (do not use B), EM is italic (without i)
HTML Knowledge Summary