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