<form action="search.php">
<input type="text" name="q" class="am-form-field">
<span class="am-input-group-btn">
<button class="am-btn am-btn-primary" type="button submit"><span class="am-icon-search"></span> </button>
</span>
</form>
我正在使用AmazeUI CSS框架
https://github.com/amazeui/amazeui/
这是CSS:
.am-form-field {
display: block;
width: 100%;
padding: 0.5em;
font-size: 1.6rem;
line-height: 1.2;
color: #555555;
vertical-align: middle;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 0;
-webkit-appearance: none;
-webkit-transition: border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;
transition: border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;
}
最佳答案
如果可以(取决于要获得的浏览器支持)使用flexbox,只需将display: flex
添加到form标记中。
否则,您可以为input.am-form-field设置宽度(例如80%或其他值),然后在其中添加float: left