In HTML, you can use the img tag to call images in lower-level directories. The specific syntax is "". To reference a file in a lower-level directory, just write the path to the file in the lower-level directory.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
To reference a file in a lower-level directory, just write the path of the file in the lower-level directory directly.
Assume the info.html path is: c:/Inetpub/wwwroot/sites/blabla/info.html
Assume the image path is: c:/Inetpub/wwwroot/sites/ blabla/html/1.jpg
The code to add pictures in info.html should be written like this:
<img src = "html/1.jpg"/>
Extended information:
How to express superiors Directory
../ represents the upper-level directory of the directory where the source file is located, ../../ represents the upper-level directory of the directory where the source file is located, and so on.
Assume the info.html path is: c:/Inetpub/wwwroot/sites/blabla/info.html
Assume the index.html path is: c:/Inetpub/wwwroot/sites/index .html
The code to add the index.html hyperlink to info.html should be written like this:
<a href = "../index.html">index.html</a>
Assume the info.html path is: c:/Inetpub/wwwroot/sites/blabla/info .html
Assume the index.html path is: c:/Inetpub/wwwroot/index.html
The code to add the index.html hyperlink to info.html should be written like this:
<a href = "../../index.html">index.html</a>
Assume the info.html path is: c:/Inetpub/wwwroot/sites/blabla/info.html
Assume the index.html path is: c:/Inetpub/wwwroot/sites/wowstory/index .html
The code to add index.html hyperlink to info.html should be written like this:
<a href = "../wowstory/index.html">index.html</a>
Recommended learning: html video tutorial
The above is the detailed content of How to call images from lower-level directories in html. For more information, please follow other related articles on the PHP Chinese website!