Html5 basic tutorials common tips _ html5 tutorial tips-

Source: Internet
Author: User
Some new properties and functions of HTML5 are to make the code more concise. This is always a good thing and should be worthy of our respect. I hope this HTML5 article will be helpful to you. 1. New Doctype statement
The XHTML statement is too long. I believe few front-end developers can write this Doctype Statement by hand.

 

The HTML5 Doctype Declaration is very short. I believe you will be able to remember this declaration immediately. You don't have to waste brain cells to remember the long, abnormal XHTML Doctype declaration.

 

The brief DOCTYPE Statement of HTML5 enables modern browsers such as Firefox and Chrome and IE6/7/8 to enter the standard mode, you may wonder that IE6/7 can also support HTML5 Doctype. In fact, IE enters the standard mode as long as the doctype complies with this format.
2.

Tag

The Code is as follows:

 Image of Mars.

Take a look at the following simple code:

Unfortunately, the h6 label and the img label seem to have nothing to do with it, and the semantics is not clear enough. HTML5 realized this, so it adopted

Tag. When Integration The use of tags can combine h6 tags and img tags to make the code more semantic.
The Code is as follows:

       
      
        This is an image of something interesting.  
       
     

3. Redefinition
Not long ago, I usedLabel to create a subtitle related to the logo. But the definition is redefined in HTML5.Tags to make them more semantic.The font size will decrease. It would be nice if this label is used for the copyright information at the bottom of the website.

4. removed the type attribute of the Javascript and CSS labels.
Normally Add the type attribute to script:

The Code is as follows:

      

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.