虽然你可以使用 line-height
,但它可能会影响下一行的文本。所以我建议这样做:
h1 {
font-size: 24px;
border-bottom: 2px solid #FF6A00;
/* proposing line height + padding */
line-height: 20px;
margin-bottom: 5px;
}
margin-bottom
。 :) - Praveen Kumar Purushothamanline-height:
来达到这个效果。line-height: 18px;
即可实现此技巧。h1 {
font-size: 24px;
padding: 0;
color: #FF6A00;
text-decoration: underline;
}
h1 span {
color: #000;
}
span
中的 h1
中即可:<h1><span>Szavazás az új domain-ról</span></h1>
请查看这个JSFiddle。
HTML
和CSS
代码? - Dipesh Parmar