Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML文档赢得';无法识别图像文件夹_Html_Image_Broken Links_Brokenimage - Fatal编程技术网

HTML文档赢得';无法识别图像文件夹

HTML文档赢得';无法识别图像文件夹,html,image,broken-links,brokenimage,Html,Image,Broken Links,Brokenimage,我有一个网页,它从我的htdocs文件夹中的images文件夹中抓取了几个图像,但它们总是显示断开的链接图标 这是我的htdocs文件夹中的层次结构: index.html style site.css scripts site.js images testing.png ... 我不明白CSS和Javascript是好的,但是图像不会加载 下面是一些代码: 这些工作: <script type="text/javascript" src="scripts

我有一个网页,它从我的
htdocs
文件夹中的
images
文件夹中抓取了几个图像,但它们总是显示断开的链接图标

这是我的
htdocs
文件夹中的层次结构:

index.html
style
    site.css
scripts
    site.js
images
    testing.png
    ...
我不明白CSS和Javascript是好的,但是图像不会加载

下面是一些代码:

这些工作:

<script type="text/javascript" src="scripts/comic.js"></script>
<link rel="stylesheet" href="styles/comic.css"/>

但这并不是:

<img id="img-0" src="images/testing.png"/>

从index.html链接应该是:
src='images/..'


在css中,您应该使用:
url(../images/..)
返回根文件夹,然后从index.html搜索
图像
目录

,链接应该是:
src='images/..'


在css中,您应该使用:
url(../images/..)
返回根文件夹,然后再搜索
图像
目录

您必须使用“./”返回目录,这就是它们被破坏的原因。

您必须使用“./”返回目录,这就是它们损坏的原因。

我认为文件夹目录有问题。 如果你的情况是这样的话

index.html
style
    site.css
scripts
    site.js
images
    img1.png
    img2.png
然后您必须使用这个(来自index.html):

如果您遇到这种情况:

index.html
style
    site.css
scripts
    site.js
img1.png
img2.png
    index.html
    style
        site.css
    scripts
        site.js
img1.png
img2.png
然后您必须使用这个(来自index.html):

如果您遇到这种情况:

index.html
style
    site.css
scripts
    site.js
img1.png
img2.png
    index.html
    style
        site.css
    scripts
        site.js
img1.png
img2.png
然后您必须使用这个(来自index.html):


我认为文件夹目录有问题。 如果你的情况是这样的话

index.html
style
    site.css
scripts
    site.js
images
    img1.png
    img2.png
然后您必须使用这个(来自index.html):

如果您遇到这种情况:

index.html
style
    site.css
scripts
    site.js
img1.png
img2.png
    index.html
    style
        site.css
    scripts
        site.js
img1.png
img2.png
然后您必须使用这个(来自index.html):

如果您遇到这种情况:

index.html
style
    site.css
scripts
    site.js
img1.png
img2.png
    index.html
    style
        site.css
    scripts
        site.js
img1.png
img2.png
然后您必须使用这个(来自index.html):


向我们显示代码以及您的图像文件夹在此结构中的位置??好的,
images
文件夹在哪里?尝试更多操作后,我发现直接访问图像在
images
文件夹中不起作用,但将其放在根目录中会起作用。我不想将所有1500个图像都移动到根目录,因此我不知道该怎么做这是一个文件夹权限问题吗?显示代码以及您的图像文件夹在此结构中的位置??好的,
images
文件夹在哪里?尝试更多操作后,我发现直接访问图像在
images
文件夹中不起作用,但是把它放在根目录中就行了。我不想将所有1500个图像移动到根目录,所以我不知道该怎么做。这是一个文件夹权限问题吗?但是我的HTML在根目录中。但是我的HTML在根目录中。我的情况是第一个。我尝试直接访问图像,但出现403错误。请尝试更改文件夹和图像的权限。我的情况是第一个。我尝试直接访问图像,但出现403错误。请尝试更改文件夹和图像的权限