css
文件中指定了_sass
属性。以下是与该问题相关的两个类别:
.quote{
width: 100%;
margin: auto;
text-align: center;
background-color: #171717;
font-size: 25px;
padding: 10px;
&.author{
width: 50%;
float: right;
font-size: 20px;
color: red;
padding: 10px;
}
}
这是Jekyll
生成的CSS代码:
section .quote { width: 100%; margin: auto; text-align: center; background-color: #171717; font-size: 25px; padding: 10px; } section .quote.author { width: 50%; float: right; font-size: 20px; color: red; padding: 10px; }
以下是相关的HTML代码:
<div class="quote"> <div id="randomquote"> Hello there, this is supposed to show a quote. </div> <div class="author"> This should be the author's name. </div> </div>
但是,author
类的属性不适用于内部div。而是具有与quote
对应的属性。这是为什么?我想念什么吗?[请注意,我打算在
author
中使用quote
。