How to call images from lower-level directories in html

醉折花枝作酒筹
Release: 2023-01-06 11:16:47
Original
5119 people have browsed it

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.

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

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

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

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

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!

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template