【发布时间】:2017-05-19 06:40:04
【问题描述】:
我有文本框和标签。我想并排显示并想 width: 100% for text(所以我需要这个 :text width change when page size change)但我没有。
这是我的代码:
<div class="col-xs-6 col-md-6">
<div class="form-group clearfix">
<label for="UxSearch">Search:</label>
<input type="text" name="UxSearch" id="UxSearch" class="form-control"/>
</div>
</div>
这是我的css类:
form-group {
margin-bottom: 15px;
}
.form-control {
display: block;
width: 100%;
height: 29px;
padding: 6px 12px;
font-size: 12px;
line-height: 1.25;
color: #555555;
background-color: #ffffff;
background-image: none;
border: 1px solid #cccccc;
border-radius: 0px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
width : 100% 有效,但文本和标签未对齐(如照片)
我尝试了 display: inline-block 但没有发生。
你能帮帮我吗?
【问题讨论】:
-
jsfiddle.net/3of3vd9g 。你在寻找这样的东西吗?
标签: html css width percentage