". To reference a file in a lower-level directory, just write the path to the file in the lower-level directory."/> ". To reference a file in a lower-level directory, just write the path to the file in the lower-level directory.">

Home  >  Article  >  Web Front-end  >  How to call images from lower-level directories in html

How to call images from lower-level directories in html

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-06-07 16:14:245050browse

In HTML, you can use the img tag to call images in lower-level directories. The specific syntax is "c44a0ef5bbb265af9e9a8c3d0834b249". To reference a file in a lower-level directory, just write the path to the file in the lower-level directory.

How to call images from lower-level directories in html

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!

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