【发布时间】:2019-12-14 05:55:48
【问题描述】:
我有一个框,其中的文本以跨度显示。我使用 line-height 来改变一个部分内的间距,但需要有不同的部分之间的距离。
查看此页面上的橙色框: https://theslowroad.org/category/destinations/asia/laos/#
我尝试使用边距和填充,但似乎没有效果。
'<span class="boxhead">' . 'Major stops:' . '</span>' . '<span class="boxtext">' . $where . '</span>' . '<br>' .
'<span class="boxhead">' . 'Memorable moment:' . '</span>' . '<span class="boxtext">' . $moment . '</span>' . '<br>' .
'<span class="boxhead">' . 'Did you know?' . '</span>' . '<span class="boxtext">' . $fact . '</span>';
?>
CSS:
.boxhead {
margin-right: 18px;
font-weight: bold;
font-style: italic;
text-transform: uppercase;
padding-bottom: 19px;
}
.boxtext {
padding-bottom: 19px;
}
.infobox {
line-height: 1.2em;
clear: both;
background-color: #bf593a;
color: white;
padding: 5%;
border-radius: 10px ;
margin-left:6%;
margin-right: 6%;
margin-top: 8%;
margin-bottom: 10%;
}
谢谢!
【问题讨论】:
-
span是内联元素,尝试使用p标记行分隔段落