Home >Web Front-end >HTML Tutorial >How to write html image path

How to write html image path

奋力向前
奋力向前Original
2021-09-08 15:30:3724099browse

How to write the path: 1. When they are in different directories, you can write "file:///drive letter:/picture name"; 2. When they are in the same directory, you can write "picture name" directly; 3. If the picture is in the a directory in the same directory, write "a/picture name"; 4. If it is an online picture, use the URL of the picture, the syntax is "http://directory/picture name" and so on.

How to write html image path

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

How to use the image path in Html57fd8f1ad5dc32419a67d07f0b20416e

1. The *html file and the *.jpg file (f drive) are in In different directories:

<img src="file:///f:/*jpg" width="300" height="120"/>

2. *.html files and *.jpg pictures are in the same directory:

<img src=".jpg" width="300" height="120"/>;

3. Pictures *.jpg are in the image folder, *html and image In the same directory

<img src="image/*jpg/"width="300" height="120"/>

4. The picture *jpg is in the image folder, *html is in the connage folder, image and connage are in the same directory:

 <img src="../image/*jpg/"width="300" height="120"/>

5. If the picture source For the network, then write the absolute path:

<img src="http://image.baidu.com/pcindexhot"/width="300" height="120"/>

Expand knowledge

Absolute path:

Picture source local: b6767ada6984c13d8c212d83919626c7

Image source network: a4f3fa8d80ea7458d96fca5f0e9d6292

Recommended learning: Html video tutorial

The above is the detailed content of How to write html image path. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to write html fileNext article:How to write html file