【发布时间】:2017-01-25 12:26:55
【问题描述】:
我正在尝试将两个 div 对齐在相同的水平位置。一个 div 向左浮动,另一个 div 向右浮动。我还将两个 div 保存在另一个 div 中,但它们仍然无法对齐到相同的水平位置。
#tray {
padding: 20px 15px;
background-color: #36648B;
color: #FFFFFF;
}
.f-left {
/*float: left !important;*/
font-size: 25px;
width: 400px;
}
.f-right {
float: right !important;
width: 200px;
}
.f-left a {
color: white;
}
<div id="tray">
<div>
<div class="f-left">Business Intelligence, CIMB</div>
<div class="f-right">
<asp:Label ID="lblUser" Font-Size="Large" Font-Bold="true" runat="server" />
<a href="WebLogin.aspx" runat="server" id="logout" onclick="web_logout">Log Out</a>
</div>
</div>
</div>
【问题讨论】:
-
你能用一些不同的方法吗?
标签: html css asp.net css-float