样式不适用于内容页面asp.net [英] Styles are not working for Content page asp.net
问题描述
当我们的应用程序部署在IIS中时,我遇到了问题。这些样式不适用于内容页面,但是当我通过VS 2010运行它时一切正常。这是我在母版页中给出的。
I'm facing a problem when our application is deployed in IIS. The styles are not applying to the content page but everything was working fine when I was running it through VS 2010. This is what I have given in the master page.
<link href="Styles/style.css" rel="stylesheet" type="text/css" />
我指定的上述代码仅适用于主页,在根目录中,但是当我导航到其他模块样式不适用于其他文件夹中的那些页面时。
我在谷歌搜索过,我尝试了很多选项喜欢
The above code which I have specified will apply only for the Home page which is in the root directory but when I navigate to so other module styles are not applying to those page which are inside other folder.
I searched in Google and I tried many options like
<link href="./Styles/style.css" rel="stylesheet" type="text/css" />
<link href="../Styles/style.css" rel="stylesheet" type="text/css" />
<link href="~/Styles/style.css" rel="stylesheet" type="text/css" />
<link href="/Styles/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
@import 'Styles/style.css'; </style>
以上所有内容都不适用于以前曾经工作过的主页。请让我知道一些建议,以便我可以继续进行。
None of the above things are working even for home page also which used to work before. Please let me know some suggestions so I can proceed further.
推荐答案
在主页面上的标题后给出你的风格参考。
喜欢:
< title>< / title>
然后该母版页的所有内容页面都可以访问样式。
Give your style's reference after title in your Master Page.
Like :
<title></title>
Then All content page of this master page can access styles.
这篇关于样式不适用于内容页面asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!