我在尝试减小这里的行距时遇到了问题。更改行高不会做任何事情。
<p><span style="color: rgb(137, 137, 137); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; line-height: 18px;"> ★</span> iPhone Investor</p>
<p><span style="color: rgb(137, 137, 137); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; line-height: 18px;"> ★</span> iPad Investor</p>
<p><span style="color: rgb(137, 137, 137); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; line-height: 18px;"> ★</span> Brokers' client</p></div>谢谢你的帮助
发布于 2015-10-27 14:07:22
可以通过将line-height样式应用于p元素而不是span元素来减小行距。
下面是一个完整的工作示例:
.spacing {
line-height: 18px;
}
.star {
color: rgb(137, 137, 137);
font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif;
}<p class="spacing">
<span class="star"> ★</span> iPhone Investor
</p>
<p class="spacing">
<span class="star"> ★</span> iPad Investor
</p>
<p class="spacing">
<span class="star"> ★</span> Brokers' client
</p>
发布于 2015-10-27 14:19:12
我不是很肯定,但我认为你指的是默认情况下添加到'p‘标签的边距。
所有的p标签都在底部有一个页边距,大约是15px;你可以用下面的代码覆盖它……
文件中的CSS ...
p { margin-bottom: 5px; }或内联
<p style="margin-bottom: 5px"></p>https://stackoverflow.com/questions/33360875
复制相似问题