XHTML Getting Started Tutorial: XHTML Web Page Image Application

XHTML Getting Started Tutorial: XHTML Web Page Image Application
<br />Adding pictures reasonably can make a web page more beautiful. Image tag <img>
The <img> tag is used to insert images into a web page. The <img> tag has an important attribute "src", and its attribute value is the address of the picture. Next we insert an image into our index.html. Open the "index.html" file and add the following code before </body>:
<p><img src="upload/2022/web/logo.gif" alt="Technical Support"/></p>
After saving, browse the web and make sure your web page is the same as this one.
We noticed that <img> is an empty tag and needs to be followed by a "/" to comply with XHTML requirements. In addition to src, the example here also has an attribute alt, which we call the replacement attribute. When the image cannot be displayed for some reason, the attribute value of alt will appear instead of the image. When the image is displayed normally, just put the mouse on the image to see the attribute value of the alt attribute. Using images as links We have learned to create hyperlinks in the previous tutorial. Now open "index.html" and change the code we just inserted to the following:
<p><a href="https://www.jb51.net/"><img src="upload/2022/web/logo.gif"alt="Technical Support"/></a></p>
After saving, browse the web page and confirm again that your web page is the same as this one. Check if the picture has become a hyperlink. Click on the picture to enter the homepage of Rookie Bar. Regarding the validation of XHTML, from this section onwards we will no longer modify the appearance of the "index.html" web page. Now we will send the web page we created to an authoritative organization for inspection. First go to: http://validator.w3.org/, this page is an XHTML validation tool, it is used to check whether the web pages we create meet the XHTML standards. You can choose to verify by URL or upload a file for verification. You can select the file upload validation as follows:
In "Validate by File Upload", there is a "Local File" column. Click Browse, find and select the "index.html" saved previously, and then click the "check" button. Your results should be the same as what we get from URL validation. The following error message is returned:
Sorry, I am unable to validate this document because on lines 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.
Are our pages not XHTML compliant? Please continue to the next section.

<<:  jQuery achieves breathing carousel effect

>>:  How to install MySQL and Redis in Docker

Recommend

5 MySQL GUI tools recommended to help you with database management

There are many database management tools for MySQ...

Do not start CSS pseudo-class names with numbers

When newbies develop div+css, they need to name t...

About CSS floating and canceling floating

Definition of Float Sets the element out of the n...

VMware vCenter 6.7 installation process (graphic tutorial)

background I originally wanted to download a 6.7 ...

Detailed explanation of Angular routing sub-routes

Table of contents 1. Sub-route syntax 2. Examples...

The rel attribute of the HTML link tag

The <link> tag defines the relationship bet...

WeChat applet realizes the effect of shaking the sieve

This article shares the specific code of the WeCh...

Knowledge about MySQL Memory storage engine

Knowledge points about Memory storage engine The ...

Briefly describe how to install Tomcat image and deploy web project in Docker

1. Install Tomcat 1. Find the tomcat image on Doc...

Detailed explanation of the usage of the alias command under Linux

1. Use of alias The alias command is used to set ...

Detailed examples of ajax usage in js and jQuery

Table of contents Native JS How to send a get req...

How to access the local machine (host machine) in Docker

Question How to access the local database in Dock...

A brief understanding of the three uses of standard SQL update statements

1. Environment: MySQL-5.0.41-win32 Windows XP Pro...

What is jQuery used for? jQuery is actually a js framework

Introduction to jQuery The jQuery library can be ...