[英]scss styling not getting applied
<body>
<div id="nav">
<ul>
<li><a href="#about">About</a></li>
<li><a href="#history">History</a></li>
<li><a href="#projects">Projects</a></li>
</ul>
</div>
<div id="firstRow>
<a id="about" class="smooth"></a>
About page goes here.
</div>
...
<script src="bundle.js" type="text/javascript"></script>
</body>
Here is how my HTML looks like and the below is the scss that I wrote 这是我的HTML外观,下面是我编写的scss
$font-stack: Helvetica, sans-serif;
$primary-color: #333;
body {
font: 100% $font-stack;
color: $primary-color;
div{
#firstRow {
height: 100px;
background-color: green;
}
}
}
But the style is not getting applied. 但是样式没有得到应用。 I followed the scss guide, but it is not working.
我遵循了scss指南,但是它不起作用。
"
missing in the <div id="firstRow">
tag id "
<div id="firstRow">
标记ID中丢失
<body>
<div id="nav">
<ul>
<li><a href="#about">About</a></li>
<li><a href="#history">History</a></li>
<li><a href="#projects">Projects</a></li>
</ul>
</div>
<div id="firstRow">
<a id="about" class="smooth"></a>
About page goes here.
</div>
...
<script src="bundle.js" type="text/javascript"></script>
</body>
Updated SCSS script, you are referring div element child of #firstRow in SCSS but HTML refer same element. 更新了SCSS脚本,您在SCSS中引用#firstRow的div元素子元素,但HTML引用相同的元素。
$font-stack: Helvetica, sans-serif; $ font-stack:Helvetica,无衬线; $primary-color: #333;
$原色:#333;
body {
font: 100% $font-stack;
color: $primary-color;
div#firstRow {
height: 100px;
background-color: green;
}
}
Or change your HTML code like below 或如下更改HTML代码
<div>
<a id="about" class="smooth"></a>
<div id="firstRow">
About page goes here.
</div>
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.