28 HTML5 features, tips, and technologies you must know

Source: Internet
Author: User

Http://tmsoft.lsxy.com/index.php? Load = read & id = 913

 

 

1. New doctype
// Zxx: "doctype" Chinese meaning "document type"

Still in use trouble. Can't you remember the XHTML document type?
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

If so, why is it still in use? Use the new HTML5 document type instead. You will live longer-as Douglas Quaid says
<! Doctype HTML>

I thought about it. I made this article for HTML5.Code, You may doubt whether the code is unreliable. Don't worry. Now this is feasible. Only the old Browser needs a specific doctype (document type ). If the browser does not know doctype, it will simply render the included labels in standard mode. So, sister, you are bold enough to throw all the care off the cloud, to embrace the new HTML5 document type.
Ii. graphic elements)

Let's take a look at the labels added to the image below:
<p> image of Mars. </P>

Text is wrapped in the p label, and it is different from the IMG label. It is hard to think of this as the title. HTML5 corrected this by using the <figure> element. When the combination of <figcaption> elements is used, we can semantically think of the title corresponding to the image.
<Figure>
<figcaption> <p> This is an image of something interesting. </P> </figcaption> </figure>
Iii. Redefinition

Not long ago, the <small> element was used to create a subtitle near the logo. This is a very useful expression element. However, this usage may not be correct now. <Small> elements have been redefined and are small characters, making them more available. Imagine the copyright status at the bottom of your website. According to the new HTML5 definition of this element, <small> can correctly wrap this information.

The small element refers to a small character ".
4. Script (scripts) and link (LINKS) do not require type

You may still add the type attribute to the link and script labels.
<LINK rel = "stylesheet" href = "path/to/stylesheet.css" type = "text/CSS"/> <SCRIPT type = "text/JavaScript" src = "path/ /script. JS "> </SCRIPT>

This is not a necessity. This means that these labels point to the style sheet and script respectively. Therefore, we can kill the type attribute together.
<LINK rel = "stylesheet" href = "path/to/stylesheet.css"/> <SCRIPT src = "path/to/script. js"> </SCRIPT>
5. quotation marks or not
... This is indeed a problem. Remember, HTML5 is not XHTML. If you don't want it, you don't have to mark your attributes with quotation marks, and you don't have to close the elements. In other words, as long as you feel comfortable, there is no right or wrong. This is the case for myself.

 

Http://tmsoft.lsxy.com/index.php? Load = read & id = 913

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.