未应用新的CSS类

时间:2017-11-04 15:13:06

标签: html css asp.net razor visual-studio-2017

我的CSS新课程出现了一个奇怪的问题 没有将风格应用于元素 我正在尝试应用样式的元素是

<p class="Review_Title">Delicious Pizza</p>
<p class="Review_Tag">@@Restaurant Name </p>
<p class="Review_Desc">Restaurant Desc.</p>
<div class="Review_Bar"></div>

这是目标看 enter image description here

这是我的样子

enter image description here

我重新启动了visual studio并清除了缓存 当我将类名从“Review_Title”更改为现有的类名称时,样式可以正常工作,但我会继续制作更多类甚至简单的类 似乎没有应用

以下是代码

提前致谢:)

这是我的Html

<div class="container-fluid">
<div class="row" style="margin-bottom: 50px; margin-top: 50px;">
    <div class="col-lg-1">
    </div>
        <div class="col-lg-5" style="padding-top:60px;">
            <p class="Review_Title">Delicious Pizza</p>
            <p class="Review_Tag">@@Restaurant Name </p>
            <span style="color:#f8bd08">&#x2605; &#x2605; &#x2605; &#x2605;</span>   &#x2605;
            <p class="Review_Desc">Restaurant Desc.</p>
            <p>Review by <b>manager@asp.net</b> on <b>19/07/2016 5:41:04pm</b></p>
            <div class="Review_Bar"></div>
        </div>
    <div class="col-lg-2">
    </div>
</div>

这是我引用样式表的地方

<environment names="Development">
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
    <link rel="stylesheet" href="~/css/site.css" />
    <link rel="stylesheet" href="~/css/mystyle.css" />
    <link href="~/css/elastic_grid.min.css" rel="stylesheet" type="text/css" />
    <link href="https://fonts.googleapis.com/css?family=Niconne" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Lato|Oxygen" rel="stylesheet" type="=text/css">

以下是mystyle.css文档中无效的类

.Review_Title{
font-size:80px;
}
.Review_Tag{
font-weight:bold;
}
.Review_Desc{
color:gray;
}
.Review_Bar {
border-bottom: 2px solid #f8bd08;
height:10px;
}

这是整个样式表

.parallax_scrolling {
background-attachment: fixed;
background-color: #645862;
background-image: url("../images/restaurant_2.jpg");
background-position: center top;
background-repeat: no-repeat;
background-size: cover;
color: #FFF;
cursor: default;
text-align: center;
padding:0px;
}
.parallax_scrolling_Row {
background-attachment: fixed;
background-color: #645862;
background-image: url("../images/restaurant_3.jpg");
background-position: center top;
background-repeat: no-repeat;
background-size: cover;
color: #FFF;
cursor: default;
text-align: center;
}
.row li{
list-style-type:none;
}
.row a {
    color: #f8bd08;
}
.dark_background {
background-color: rgba(31, 20, 20, 0.6);
padding: 40px 0px;
}
.oxygen {
font-family: 'Oxygen', sans-serif;
font-size: 28px;
color: white;
letter-spacing: 5px;
text-align: center;
text-transform: uppercase;
padding: 5px 10px 5px 10px;
margin: 60px 0px 60px 0px;
border: 2px solid #FFF;
}
.oxygen_info_banner {
font-family: 'Oxygen', sans-serif;
font-size: 26px;
color: black;
letter-spacing: 5px;
text-transform: uppercase;
}
.niconne_info_banner {
font-family: 'Niconne', cursive;
color: #f8bd08;
font-size: 55px;
}
.lato {
font-family: 'Lato', sans-serif;
text-align: center;
font-size: 28px;
}
.niconne {
font-family: 'Niconne', cursive;
color: #f8bd08;
font-size: 65px;
text-align: center;
font-weight: 400;
}
.niconne_Row {
font-family: 'Niconne', cursive;
color: #f8bd08;
font-size: 50px;
text-align: center;
font-weight: 400;
}
.title_banner {
border-top: 2px solid #f8bd08;
border-bottom: 2px solid #f8bd08;
padding-top:10px;
padding-bottom:10px;
margin-top:30px;
margin-bottom:30px;
font-family: 'Niconne', cursive;
color: #f8bd08;
font-size: 60px;
text-align: center;
font-weight: 400;
}
.title_banner h1 {
font-size:50px;
}
.collapse_Box {
border:none;
}
.review_box {
background-color:Highlight;
height:500px;
}
#Italian_Button_Dropdown{
border:1px solid gray;
background-color:lightgray;
border-radius:4px;
padding:6px;
}
#Italian_dropdown {
border:2px solid gray;
border-width:0px 1px 1px 1px;

}
#Asian_dropdown {
border: 2px solid gray;
border-width: 0px 1px 1px 1px;
}
.Review_Title{
font-size:80px;

}
.Review_Tag{
font-weight:bold;
}
.Review_Desc{
color:gray;
} 
.Review_Bar {
border-bottom: 2px solid #f8bd08;
height:10px;
}

1 个答案:

答案 0 :(得分:1)

  1. 您可以在浏览器中使用Inspect模式来检查您创建的HTML元素和相关样式。
  2. 我看到你没有在Review_Bar类中创建任何按钮
  3. 如果您在第一步中无法找到与您的元素相关的任何CSS,那么您最好检查CSS文件的路径