我ul
获得了li
,我想让li
更小,我用height:30px
做了,但现在文字不在li
的中间:
如何解决?
.properties_list .property_item
{
display:inline-block;
font-size:15px;
}
.properties_list
{
font-family: Verdana, Arial, Helvetica, sans-serif;
height: 30px;
text-align: left;
}
.property_item
{
margin-right: 3px;
height:30px;
}
<ul class="list-group properties_list treemenu">
<li class="btn btn-active property_item list-group-item tree-empty">Property1</li>
<li class="btn btn-active property_item list-group-item tree-empty">Property2</li>
<li class="btn btn-active property_item list-group-item tree-empty">Property3</li><li class="btn btn-active property_item list-group-item tree-empty">Property4</li><li class="btn btn-active property_item list-group-item tree-empty">Property5</li><li class="btn btn-active property_item list-group-item tree-empty">Property6</li><li class="btn btn-active property_item list-group-item tree-empty">Property7</li><li class="btn btn-active property_item list-group-item tree-empty">Property8</li></ul>
答案 0 :(得分:1)
在line-height: 30px;
课程中添加.property_item
以获取
.properties_list .property_item {
display: inline-block;
font-size: 15px;
}
.properties_list {
font-family: Verdana, Arial, Helvetica, sans-serif;
height: 30px;
text-align: left;
}
.property_item {
margin-right: 3px;
height: 30px;
line-height: 30px;
border: 1px solid;
width: 100px;
text-align: center;
}
&#13;
<ul class="list-group properties_list treemenu">
<li class="btn btn-active property_item list-group-item tree-empty">Property1</li>
<li class="btn btn-active property_item list-group-item tree-empty">Property2</li>
<li class="btn btn-active property_item list-group-item tree-empty">Property3</li>
<li class="btn btn-active property_item list-group-item tree-empty">Property4</li>
<li class="btn btn-active property_item list-group-item tree-empty">Property5</li>
<li class="btn btn-active property_item list-group-item tree-empty">Property6</li>
<li class="btn btn-active property_item list-group-item tree-empty">Property7</li>
<li class="btn btn-active property_item list-group-item tree-empty">Property8</li>
</ul>
&#13;