如何找到css的图像路径 [英] How can find the image path for css

查看:67
本文介绍了如何找到css的图像路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 css 和 Bootstrap 的新手,很抱歉,如果有愚蠢的问题.

I am new for for css and Bootstrap so sorry if silly question.

我想在我的项目中使用 Bootstrap.我找到了一个教程并打算遵循.在教程中有一个文件夹,当我运行 index.html 文件时,您可以看到带有徽标的页面.

I want to use the Bootstrap in my project. I found a tutorial and going to follow. In the tutorial There is a folder and when I run the index.html file then you can see page with the logo.

我正在尝试在我的项目中使用引导程序和 css.我尝试在我的项目中使用 main.phtml我先运行我的文件,但我看不到 logo(image) 和 我在想问题是 .css 文件的路径

I am trying to use the bootstrap and css in my project. I tried make same in my project with main.phtml I run my file first and I could not see the logo(image) and I was thinking the problem is the path of .css file

问题是当我将我的 html 文件放在任何目录而不是主项目(没有任何目录)下时,我看不到徽标.

The problem is when I put my html file in any directory rather than under main project(no any directory) I cannot see the logo.

下面前两张截图是教程文件截图,后两张截图是我的文件截图.(我没有分享任何代码,因为 css 和 html 文件正在工作)

Below first two screenshot is the tutorial file screenshots and the second two screenshot is the my file screenshots. (I did not share any code because the css and html files are working)

有人可以向我解释为什么我们不能使用目录中的 html 文件,如果可以,我们该如何管理?

Can someone explain to me why we cannot use the html files in directory or if yes how can we manage?

但是当我尝试添加我的项目时,我看不到徽标.

but when I try to add my project I cannot see the logo.

和视图;

编辑

推荐答案

请在此处查看:

https://stackoverflow.com/a/20047417/6284581

您不必移动 .html 文件

您的示例 cssimg 路径未正确说明.

Your example css and img path not state correctly.

../ 表示向上一个文件目录(查看上面的链接)!在您的示例中,如果您从web... 然后你需要进入主项目目录.试试这个

../ means one file directory up(check link above)! In your example if you start from web... then you need to go main project directory. Try this

<a class="navbar-brand" href="#"><img src="../web/static/style/img/logo.png"></a>

希望对你有帮助

这篇关于如何找到css的图像路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆