<style>
.bgClr{
background-color: lightgreen;
}
</style>
<link href=@Url.Content("~/Content/css/xyz.css") rel="stylesheet" />
<div>......
<input type="text" class="bgClr" />
....</div>
Run Code Online (Sandbox Code Playgroud)
这是我在html页面中编写的代码.在xyz.css中,我已经定义了相同的css类
.bgClr{
background-color: red;
} // in xyz.css
Run Code Online (Sandbox Code Playgroud)
但结果是,控件的背景颜色始终为红色.
我可以知道为什么总是采用xyz.css的.bgClr吗?