我一直试图在我的HTML模板的name="size"
中更改搜索框的宽度,但即使我尝试width:
也无法执行此操作。
HTML:
<form class="form" method = "POST" >
<h1>Soccer Shoes Finder</h1>
<div class="line-separator"></div>
<div class="container-fluid form-inline">
<input class="form-control" name = "name" type="text" placeholder="Name"/>
<input class="form-control" name = "size" type="text" placeholder="Size"/>
<button class="form-control fa fa-search" aria-hidden="true"></button>
</div>
</form>
元素的css:
input[name="size"]{
width: 50%;
}
这里有一个更好的上下文的代码:
答案 0 :(得分:4)
我建议使用此方法。
<form class="form" method="POST">
<h1 class="text-center">Soccer Shoes Finder</h1>
<div class="line-separator"></div>
<div class="container ">
<div class="row">
<div class="col-md-4">
<input class="form-control" name="name" type="text" placeholder="Name" />
</div>
<div class="col-md-7">
<input class="form-control" name="size" type="text" placeholder="Size" /></div>
<div class="col-md-1">
<button class="form-control " aria-hidden="true"><i class="fa fa-search"></i></button></div>
</div>
</div>
</form>
更新了Codepen: http://codepen.io/hunzaboy/pen/aJJpMK
答案 1 :(得分:2)
它被引导程序默认值覆盖。具体做法是:
using (var client = new DefaultSoapClient())
{
client.Login("admin", "123", null, null, null);
try
{
var order = new SalesOrder()
{
OrderType = new StringSearch { Value = "SO" },
OrderNbr = new StringSearch { Value = "SO003729" }
};
order = client.Get(order) as SalesOrder;
order.ShippingTerms = new StringValue { Value = "FLATRATE1" };
client.Put(order);
}
finally
{
client.Logout();
}
}
您需要调整选择器以修复级联:
.form-inline .form-control {
display: inline-block;
width: auto;
vertical-align: middle;
}
答案 2 :(得分:1)
输入元素默认使用display: inline;
,您无法在使用该显示的元素中定义宽度,如果您将显示更改为display: inline-block;
,则可以更改元素的宽度。
input[name="size"]{
width: 50%;
display: inline-block; /* <--- Here the change */
}
答案 3 :(得分:0)
你尝试过尺寸属性吗?
<input type="text" size="15"/>