Home>Article>Web Front-end> How to add img path in html
In the img tag in HTML, you can use the "src" attribute to add the img image path, which is used to specify the URL of the image, with the syntax "dd90d00c79218b861f64ffe0b163d4af". The URL can be a relative path, such as "//m.sbmmt.com/m/faq/../image/*jpg/"; it can also be an absolute path, that is, the complete URL pointing to the image file.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
HTML a1f02c36ba31691bcfe87b2722de723b tag
a1f02c36ba31691bcfe87b2722de723b tag defines an image in an HTML page.
Note: Technically, images are not inserted into the HTML page, but linked to it. The a1f02c36ba31691bcfe87b2722de723b tag creates a placeholder for the referenced image.
HTML a1f02c36ba31691bcfe87b2722de723b src attribute
The src attribute of the img tag is required. It specifies the URL of the image.
Syntax
Note: When a web page loads, the browser fetches the image from the web server and inserts it into the page. Therefore, make sure the image is at the same point as the relevant web page, otherwise visitors may get a broken link icon. If the browser cannot find the image, it will display a broken link icon.
[Recommended tutorial: "html video tutorial"]
Usage of 57fd8f1ad5dc32419a67d07f0b20416e image path in HTML Method
1. *html files and *.jpg files (f drive) are in different directories:
2. *.html files and *.jpg pictures In the same directory:
3. *.html files and *.jpg pictures are in different directories:
a. Pictures *.jpg are in the image folder, *html and image In the same directory:
b, the picture *jpg is in the image folder, *html is in the connage folder, image and connage are in the same directory:
4 . If the picture comes from the Internet, then write the absolute path:
Extended information:
The absolute pathrefers to The absolute position under the directory, directly reaching the target location, usually the path starting from the drive letter (root directory).
The path that completely describes the file location is the absolute path, which is the directory path based on the root directory of the web site. The absolute path name is specified from the root directory at the top of the tree directory structure to a directory or file. It consists of a series of consecutive directories separated by slashes until the directory or file to be specified. The last name is the directory or file to point to. The reason why it is called absolute means that when all web pages reference the same file, the path used is the same.
//绝对路径,指向一个因特网文件的完整 URL
Relative pathrefers to the path relationship with other files (or folders) caused by the path where this file is located. Using relative paths can bring us a lot of convenience. HTML absolute path refers to the full path of the file with domain name.
//文件路径指向了位于当前网站根目录中 images 文件夹里的一个文件:
For more programming-related knowledge, please visit:Programming Video! !
The above is the detailed content of How to add img path in html. For more information, please follow other related articles on the PHP Chinese website!