css - 如何使此输入文本字段响应
问题描述
在完整窗口中打开并调整窗口大小,输入字段没有响应,因此按钮移动到输入下方,这不是我想要的。
.coupon {
width: 100%;
max-width: 500px;
outline: none;
margin: 0;
box-sizing: border-box;
height: 22px;
}
.coupon-btn {
background: #21b85b;
border: 0;
padding: 7px 20px 7px 20px;
text-transform: uppercase;
color: #fff;
display: inline;
font-size:0.875;
max-width: 100%;
}
<input type="text" class="coupon input-res">
<button class="coupon-btn">Apply</button>
解决方案
像这样试试
.flex-col {
display: flex;
display: -webkit-flex;
}
.coupon {
width: 100%;
max-width: 500px;
outline: none;
margin: 0;
box-sizing: border-box;
height: 30px;
}
.coupon-btn {
background: #21b85b;
border: 0;
padding: 7px 20px 7px 20px;
text-transform: uppercase;
color: #fff;
display: inline;
font-size: 0.875;
max-width: 100%;
}
<div class="flex-col">
<input type="text" class="coupon input-res">
<button class="coupon-btn">Apply</button>
</div>
推荐阅读
- javascript - 在用户选择至少一个复选框之前,如何设置下一个按钮不可用?
- vba - 允许在 MS Access 表单的文本框中添加数据但不允许删除数据
- android - Android TV:如何添加密码操作
- javascript - 无法读取 null 的属性“getSheetId”;不知道为什么会这样
- asp.net - 如何使用 axios 将文件上传 POST 到 ASP.NET 控制器?
- azure - 带有性能计数器的 Azure Service Fabric 上的 Azure Application Insights
- c++ - C++ ELF 目标文件符号表具有两次列出的函数
- ruby-on-rails - Puma MiniSSL SSLError 运行 rails 服务器时出现 OpenSSL 错误
- rxjs - withLatestFrom 意外行为
- python - Sharepoint 使用 shareplum 库插入