site.css不适用于我的示例网站 [英] site.css is not working for my sample web site

查看:67
本文介绍了site.css不适用于我的示例网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新手在这里.

我在VS2010中创建了一个空的MVC项目,并且正在尝试格式化视图以进行身份​​验证.因此,我已将其添加到site.css:

I have created an empty MVC project in VS2010 and I'm trying to format my view for authentication. So, I've added this to site.css:

.rez 
{
color: Olive;
}

并将其显示在我的视图中:

and this to my View:

@using (Html.BeginForm())
{
<div>
<label class="rez">Username</label><input type="text" name="Username"/>
</div>
<div>
Password<input type="password" name="Password"/>
</div>
<div>
<input type="submit" name="Log"/>
</div>
}

它不起作用.我没有碰过路由或bundleconfig.我已经配置了web.config进行身份验证. _ViewStart和_Layout也保持不变.

It's not working. I haven't touched routing or bundleconfig. I've configured web.config for authentication. _ViewStart and _Layout are also unchanged.

我在做什么错,更重要的是如何调试此问题.我正在使用Chrome.

What am I doing wrong and more importantly how do I debug this issue. I'm using chrome.

推荐答案

我遇到了同样的问题,我发现文件名是" Site.css ",文件名是在 BundleConfig.cs 中被引用的是带有小写 s 的" site.css ".我只是匹配了文件名就可以了.

I had the same problem and I found out that the name of the file is "Site.css" and the file which is getting referenced in the BundleConfig.cs is "site.css" with lowercase s. I simply matched the file names and it worked.

要尝试的另一件事是打开浏览器的检查元素,右键单击刷新按钮,然后单击空缓存并进行硬重装.

edit: another thing to try is open inspect element of your browser, right click on the refresh button and hit empty cache and hard reload.

这篇关于site.css不适用于我的示例网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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