我在添加黄色引用块时遇到了问题,它会缩进/增加不需要的行高。
这是我要实现的效果:
这是我尝试过的方法:
.contentquote {
font-family: 'Roboto Slab', serif;
font-size: 20px;
}
.quote {
line-height: color: #003b49;
font-size: 2.9em;
}
<h1 class="contentquote"><span class="quote">“</span>In my circles, when I talk to people about which firm is the best thinker in this (value-based care) area and which firm couples that with actual execution, we talk about Premier...<span class="quote">”</span></h1>
在此附上链接: 非常感谢您的帮助!
.qoute
上加上color: yellow;
,对吧? - user8256287<q>
标签),则可以在 CSS 中使用 before 和 after 伪元素,这样就不必在 HTML 中包含引用span
。将所有共享属性(字体、颜色、大小、显示等)分配给q::before, q::after {}
,然后使用q::before {content:'“';}
和q::after {content:'”';}
分配引号。引号的实际定位可能需要进行一些微调(请参见下面的答案),但这将节省一些标记并改善可访问性。 - Bmd