【发布时间】:2016-07-22 10:51:23
【问题描述】:
为此,我将元素显示为内联,并分别设置了左右浮动。但他们显示的是这样的:
您可以看到它们没有正确对齐。
.selected-account{
display: inline;
float: right;
color: #0679ca;
}
.select-account-accordion{
display: inline;
float: left;
color: #0679ca;
}
<div id="select-account" class="col-sm-12 col-md-12 disabled-billing-accordion">
<h3 id="select-acct" class="select-account-accordion">Select Account(s)</h3>
<span id="account-selected" class="selected-account">0 of 8 account selected</span>
</div>
您能就此提出建议吗?
编辑:我认为是因为我将这两个元素放在了用于创建手风琴的 div 类中,所以这就是它造成麻烦的原因。请参阅下面的样式以了解具有“disabled-billing-accordion”类的 div
.disabled-billing-accordion h3::before{
background: url("/static/img/accordion.png") no-repeat scroll 0 0
rgba(0, 0, 0, 0);
background-position: -1px -97px;
content: " ";
width: 34px;
height: 34px;
left: 0;
position: absolute;
top: 25px;
margin-left: 1em
}
.disabled-billing-accordion h3{
padding: .2em 0 0 3em;
color: #0679ca;
font-size: 1.5em;
line-height: 2.1875em;
margin-bottom: 8px;
font-weight: 100 !important
}
.disabled-billing-accordion{
padding: 10px;
border-bottom: 1px solid #bdbdbd
}
【问题讨论】: