如何从文件夹链接css [英] How to link css from a folder

查看:81
本文介绍了如何从文件夹链接css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,如何将CSS链接到Solution的子文件夹上的页面



我知道如何链接CSS及其在我的页面上工作



I have a question, how do you link CSS to pages on Solution's subfolder

I know how to link CSS and its working on my pages

<link rel="stylesheet" type="text/css" href="Stylesheet/Default.css" />





我还有其他网页文件夹例如



我有一个名为adminpages的文件夹,里面是adminpage1等等...

但是,当我使用上面的代码时,它没有得到css属性..





如何正确链接它?



I also have other webpages inside folders forexample

I have a folder named adminpages and inside are adminpage1 and so on...
however, when I use the code above, It does not get the css properties..


how can I properly link it?

推荐答案

在visual studio中,打开你的aspx页面,然后从解决方案资源管理器中拖出你的css文件并将其放到你的aspx页面的head部分,它会自动地为你创建链接。
In visual studio, open your aspx page, then drag you css file from solution explorer and drop it onto the head section of your aspx page, it will automatively create the link for you.


我不清楚您的目录结构。我只是给出一般性描述。如果文件位于子文件夹中,则可以使用文件夹名称,如示例所示。如果它在外面,那么你需要使用..转到父级,然后导航回相应的子文件夹。但最好的解决方案是使用〜来指定完整路径。即使将文件移动到网站的不同位置,这也会起作用。
I am not clear with your directory structure. I am just giving a general description. If the file is on subfolder then you can use folder name as in your example. If it is outside then you need to use ".." to go to parent and then navigate back respective subfolder. But the best solution is to use "~" to specify the complete path. This will work even when the file is moved to different location with the website.


这篇关于如何从文件夹链接css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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