假设我们有一个带有输入和按钮元素的标准表单,如下例所示。我们如何使用CSS Flexbox水平和响应拉伸此表单?
<div>
<form class="sampleform" onSubmit={this.onSubmit}>
<input
type="text"
class="input-text"
name="sampleinput"
placeholder="A placeholder ..."
/>
<button
type="submit"
class="button"
>➕
</button>
</form>
</div>
答案 0 :(得分:0)
像这样:
form {
display: flex;
}
input {
width: 100%;
}
&#13;
<div>
<form class="sampleform" onSubmit={this.onSubmit}>
<input
type="text"
class="input-text"
name="sampleinput"
placeholder="A placeholder ..."
/>
<button
type="submit"
class="button"
>➕
</button>
</form>
</div>
&#13;