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.
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
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"/>
Absolute path:
Picture source local: < img src="file:///E:/Scripts/HTMLScripts/pics/陈浩.jpg"/>
Image source network:
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!