HTML uses absolute positioning and relative positioning to reference pictures

Absolute positioning:

Use the address of the file on the local computer directly. For example, the location of my picture is:

C:\Users\Pictures\11.jpg

Then finally you can write:

<img src="C:\Users\Pictures\11.jpg">

Relative positioning:

(All the following are hyperlinks)
1. The picture and the html file are in the same directory,
then the file name of the picture can be written directly

<a href="11.jpg">11.jpg</a>

2. The picture is at the next level of the directory where the html file is located

<a href="pictures\11.jpg">11.jpg</a>

The same goes for the lower level, and so on

<a href="pictures\css\11.jpg">11.jpg</a>

3. If the picture is at the upper level of the html file,
then use.. \ To indicate the upper level, then the upper level is.. \. .\

<a href="..\css\11.jpg">11.jpg</a>
<a href="..\..\css\11.jpg">11.jpg</a>

Guess you like

Origin blog.csdn.net/weixin_45755679/article/details/114363029
Recommended