1
我试图在Angular中使用scss来改变h3标签的边距。 scss正在工作,但是当我将h3嵌套在div标签中时,它不起作用。scss中嵌套的h3不起作用
有人能指出我正确的方向吗?
SCSS
// Does not work
.subTitle {
h3 {
margin-top: 1px;
}
}
// Works
h3 {
margin-top: 1px;
}
HTML
<div class="row">
<div *ngFor="let post of allPosts" class="col-md-12 blogPost">
<div id="title"><h1>{{post.title}}</h1></div>
<div id="subTitle"><h3>{{post.subTitle}}</h3></div>
<div id="blogContent"><p>{{post.content}}</p></div>
</div>
</div>
JS
使用dev工具栏来检查输出html dom的样子(检查角度如何为您生成DOM)。 – Dekel