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

How to write html image path

奋力向前
Release: 2023-01-07 11:47:39
Original
24126 people have browsed it

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 Html

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

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

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

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

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

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

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"/>
Copy after login

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

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

Expand knowledge

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template