Image Tag
labels are used to insert images into a webpage. A tag has a required attribute "src". Its attribute value is the image address. Next we will insert an image in our index.html. Open the upload index.html file and add the following before </body>:Code:
<P> Alt = "Technical Support"/> </P>
Save and view the web page. Please confirm that your web page andThis pageSame.
We noticed that is also an empty tag, and a "/" should be added at the end to meet XHTML requirements. In this example, there is an attribute ALT in addition to SRC. We call it a replacement attribute. When an image cannot be displayed for some reason, the attribute value of ALT will appear instead of the image; when the image is normally displayed, you can see the attribute value of the alt attribute by hovering the cursor over the image.
Use images as links
In our previous tutorial, we learned how to create a super chain. Next, we opened "index.html" and changed the newly inserted code to the following section:
<P> <a href = "http://www.cainiao8.com/">
Alt = "Technical Support"/> </a> </P>
Save and browse the Web page. Please confirm your web page andThis webpageSame. Check if the image has changed to a hyperlink. Click a hyperlink to go to The cainiao homepage.
XHTML Validation
Starting from this section, we will no longer modify the appearance of the "index.html" webpage. Now, we will send the webpage we created to an authority for inspection. First, go:Http://validator.w3.org/This page is an XHTML verification tool used to verify whether the webpage we created conforms to the XHTML standard. You can select to use the URL for verification or upload a file for verification. You can select the File Upload verification method as follows:
In the "validate by File Upload" column "local file", Click Browse, find and select the previously saved "index.html", and then click "check. Your results should be consistent with ourResults of website VerificationSame. The following error message is returned:
Sorry, I am unable to validate this document because on line3, 6-9, 12-14, 16-22It 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.
Isn't our webpage conforming to the XHTML standard? Continue to read the content in the next section.