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

Linux super detailed gcc upgrade process

Table of contents Preface 1. Current gcc version ...

Detailed explanation of several solutions for JavaScript interruption requests

Table of contents 1 Promise Interrupt the call ch...

Share some tips on using JavaScript operators

Table of contents 1. Optional chaining operator [...

Practice of using SuperMap in Vue

Table of contents Preface Related Materials Vue p...

How to install nginx in centos7

Install the required environment 1. gcc installat...

JS, CSS style reference writing

CSS: 1. <link type="text/css" href=&q...

Mysql optimization Zabbix partition optimization

The biggest bottleneck of using zabbix is ​​the d...

DD DT DL tag usage examples

We usually use the <ul><li> tags, but ...

React implementation example using Amap (react-amap)

The PC version of React was refactored to use Ama...

How to enable the slow query log function in MySQL

The MySQL slow query log is very useful for track...

Quickly install MySQL5.7 compressed package on Windows

This article shares with you how to install the M...

Have you carefully understood Tags How it is defined How to use

Preface : Today I was asked, "Have you carefu...

Example code for implementing triangles and arrows through CSS borders

1. CSS Box Model The box includes: margin, border...

JS implements the sample code of decimal conversion to hexadecimal

Preface When we write code, we occasionally encou...