我试图在一行中放置3个div。我有下面的代码,最大的问题是,第二个div不会结束第三次启动。该行也应该垂直对齐文本的中心。结果应该如下所示https://www.linksketch.com/XOfi 第一个div中的文本可能会因长度而异。所以我不能指定它的宽度(或第二个宽度)。 两个div向左浮动,一个向右浮动
.activityType {
color: #007b87;
font-size: 20px;
float: left;
margin: 0 5px 0 0;
}
.lineActivities {
height: 1px;
margin-bottom: 10px;
margin-left: 10px;
background-color: #afbc16;
opacity: .4;
margin: 10px 10px 2px 0;
overflow: hidden;
}
.activityDate {
color: #007b87;
font-size: 15px;
float: right;
margin-right: 25px;
width: 140px;
}
<!-- First div with text aligned to left. -->
<div class="activityType">
User created tiket
</div>
<!-- Second div with colored line going from 1. to 3. div (filling the gap). -->
<div class="lineActivities">
</div>
<!-- Third div with text. -->
<div class="activityDate">
23. 02. 2015 01:31:33
</div>
而你试过了什么? –
你提供的链接是要求输入密码... –
现在链接应该工作。 –