Adding pictures reasonably can make a web page more beautiful.
The <img> tag is used to insert pictures into web pages. The <img> tag has an important attribute src, and its attribute value is the address of the image. Let's insert a picture in our index.html. Open the index.html file and add the following code before </body>:
| <p><img src=http://www.CuoXIn.com/images/logo.gif alt=Technical Support/</p> |
After saving, browse the website, please confirm that your web page is the same as this page.
We note that <img> is an empty tag, and one/ needs to be added at the end to meet the requirements of XHTML. In addition to src, there is also an attribute alt. We call it a replacement attribute. When the image cannot be displayed for some reason, the attribute value of the alt will appear instead of the image; and when the image is displayed normally, just stop the mouse on the image and you will see the attribute value of the alt attribute.
We have learned to create hyperlinks in the previous tutorial. Let's open index.html and change the code you just inserted into the following paragraph:
| <p><a href=http://www.CuoXIn.com/images/logo.gifalt=Technical Support/</a></p> |
After saving, browse the web page, please confirm again that your web page is the same as this web page. Check if the picture has become a hyperlink. Click on the picture and you will enter the homepage of the novices.
From this section on, we will no longer modify the appearance of the index.html web page. Now we will send the web page we have made to an authoritative organization for inspection. First enter: http://validator.w3.org/, which is an XHTML validation tool, which is used to check whether the web pages we make comply with the XHTML standards. You can choose to use URL verification or upload file verification. You can choose file upload validation as follows:
In Validate by File Upload, there is a Local File column, click Browse, find and select the index.html you saved before, and then click the check button. Your results should be the same as our results through the URL validation. Returns the following error message:
| Sorry, I am unable to validate this document because on line 3, 6-9, 12-14, 16-22 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication. |