【发布时间】:2016-06-02 23:17:56
【问题描述】:
我有这个小代码包含一个文本(标签)和一个文本输入
我正在寻找的是让文本 + 输入占 div 的 100%(即 20% 用于文本,80% 用于输入)并且文本应位于其区域的中间,背景具有相同的高度作为输入。
我尝试使用 span,在 div 上应用background-color: blue;,但没有任何影响。
你知道怎么做吗?
提前谢谢你。
#zoneFiltre {
width: 100%;
}
.champs {
width:20%;
background-color: blue;
text-align: middle;
color: white;
}
#filtreMultiAptitudes{
width:80%;
float:right;
}
<div id="listeMultiAptitude">
<div class="zoneFiltre">
<label class="champs">filter: </label>
<input type="text" id="filtreMultiAptitudes" />
</div>
</div>
【问题讨论】: