Introduction to XHTML: webpage Head and DTD_HTML/Xhtml _ webpage Creation

Source: Internet
Author: User
Although the head and DTD are not displayed on the page, they are an important element of the web page. Why is an error? In the previous section, we got an error message when checking our webpage, But we wrote the code according to the XHTML standard throughout the webpage creation process. In fact, the problem lies in the & ldquo; Header & rdquo; of the webpage. Here we will solve this problem. Although the head and DTD are not displayed on the page, they are an important element of the web page. Why is an error?
In the previous section, we got an error message when checking our webpage, But we wrote the code according to the XHTML standard throughout the webpage creation process. In fact, the problem lies in the "Header" of the webpage. Next we will solve this problem.Part
In the previous tutorial We modified all the labels.Content, that is, the content displayed on the page. In XHTMLWhat is it about? In factSome of the information that can be "visible" in browsers can be added to me. Next we will introduce some common head labels.
Note: Most of the labels and attributes in this section are hard to remember. In fact, they are automatically generated when we use the web page creation software to create webpages. The purpose of this section is to understand the meaning of these labels and make some manual modifications when necessary. Now, open our javasindex.html ",Insert the following code in the middle:
1.
This code tells the browser that our webpage uses the gb2312 Chinese character encoding. Information is one of the reasons for the problem during the last test.
2.
This code is the keyword of index.html written for the search engine.
Please note that, The tag is also an empty tag. Do not forget to add /. The role of tags is far more than that. However, it is difficult to understand the labels in the absence of practical applications. The actual use of tags. If you want to learn more The tag knowledge can be found in Baidu. AboutLabel description
As mentioned earlier,Some of the content is not written for the viewer, but for the browser and search engine. ThereforeSome should not contain any visible content on the page. DTD
If we verify our webpage again now, we still get an error message indicating that the DTD file cannot be found, what is the DTD file? To put it simply, anyone (usually a software similar to a browser) wants to read our files and tell them which rule we follow. Take the verification process as an example. If we use the DTD of HTML4.01, The validators will think that we are using the web page written by the HTML4.01 rule, then, according to the corresponding rules, check our code line by line, and finally return the test result.
The webpage we create uses XHTML rules, and of course the xhtml dtd. However, as we mentioned earlier, the xhtml dtd is also divided into a relatively loose transitional DTD and a strict DTD with strict requirements. In this tutorial, we will declare a strict DTD on the webpage. If you want to know

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.