CSS3 and H5 notes finishing

Source: Internet
Author: User

H5 added feature semantic tagging such as section article meter footer progress etc.

HTML code

H5 added the function of important custom attributes;

Adding a custom attribute to a label must start with data-
Custom properties need to be obtained by dateset[] Way
such as the custom attribute Data-box
Get Custom Properties DataSet
Set custom properties dataset["box"];

<!--definition Data list
<datalist id= "Sex" >
<option > Men </option>
<option > Women </option>
<option > Ominous </option>
</datalist>

<!-definition metric,
<label for= "#" >
Metric: <meter value= "max=" "min=" 0 "low=" "high=" ></meter>
</label>

<!-Define progress bar,
<progress value= "max=" min= "0" ></progress>

<!-define phone pattern available regular
<label for= "" >
Tel: <input type= "Tel" pattern= "1\d{10}"/>
</label>

<!--audio compatibility    autoplay: Auto Play    controls: Control bar    Loop: loop--
<audio Controls Loop>
<source src= ">
<source src= ""/>
<source src= ""/>
Sorry, your browser does not support audio tags!
</audio>
<!--similar tags in video-->

JS Code   
The Oninput event is  triggered when user input
The Oninvalid event is typically used to set hint text that is not validated by outdated
H5 adds a method similar to the jquery operation class name  Classlist

var box1=  document.queryselector ('. Box1 ');
Add class Name
Box1.classList.add (' active ');

       Delete class name
Box1.classList.remove (' active ');

       determine if a class name is included to  return the result true/false
  var f=box1.classlist.contains (' active ');

       Toggle Class Name   
Classlist.toggle (' active ');


CSS3 and H5 notes finishing

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.