Let’s try to make a simple web page. I hope you can follow us, it will only take you a minute. Now you may not know what those angle brackets <> and letters inside are. Don't worry, we will introduce them to you in the tutorial below.
First, please run Notepad, or create a new text document anywhere, and enter the following content in Notepad:
| The following is the quoted content: <html> <head> <title>I am the title of this page</title> </head> <body> <p>This is my first page. </p> </body> </html> |
After entering, save the file and name it index.html. (Click File—>Save As. Fill in the file name column into index.html, select all files in the save type column, and then click the Save button)
After saving, double-click the file and the browser will automatically open the web page. Please confirm whether your web page is the same as the page. If it is the same, then you have successfully completed your first relatively simple web page.
Please note that this is just a simple page. Although it is syntactically compliant with XHTML standards, it still lacks some content if it is to be a complete, W3C-compliant XHTML webpage. The relevant content will be introduced in the tutorial below. This web page is just used to explain some basic XHTML knowledge.
Explanation of basic knowledgeThe web pages we just made start with <html> and end with</html>, which represent the beginning and end of the web page file respectively.
In English, head means head, body means body. The two parts of the web page represent the head and body of the web page respectively. Maybe you have noticed that there is a <title></title> in the head of our web page. The word title means title, and the title of the web page will be displayed in the title bar above the browser. The body of the web page, that is, the content between the <body> and</body> tags, will be displayed in the browser as the text.
This web page is very thin, and there is nothing in the head and body. We will gradually enrich the content of the web page in future tutorials. But now please remember a concept: the head of the web page is written for the browser, it will not be displayed on the page, and the body is written for the user of the website, and it is the content that the browser will display.
Example of errors in rookie spoof XHTMLOpen the following two error examples. Both of their codes have very serious errors, but the browser will accurately display these two web pages.
| Example 1-The body grows in the head <html> <head> <title>I am the title of this page</title> <p>This is my first page. </p> </head> <body> </body> </html> |