gpt4 book ai didi

html - 表单和其他按钮不会内联显示

转载 作者:太空宇宙 更新时间:2023-11-03 20:39:59 29 4
gpt4 key购买 nike

如何让上一个和下一个按钮与表单选择元素位于同一行?我尝试使用 display:inline 但它不起作用。

button {
display:inline;
}
<button onclick="location.href='?view=list&month=August&year=2014'">Prev</button>
<form action="index?view=list" class="pure-form pure-form-aligned" style="margin:20px;">
<input type="hidden" name="view" value="list" />
<select name="month" onchange="this.form.submit();">
<option value="January" >January</option>
<option value="February" >February</option>
<option value="March" >March</option>
<option value="April" >April</option>
<option value="May" >May</option>
<option value="June" >June</option>
<option value="July" >July</option>
<option value="August" >August</option>
<option value="September" Selected>September</option>
<option value="October" >October</option>
<option value="November" >November</option>
<option value="December" >December</option>
</select>
<select name="year" onchange="this.form.submit();">
<option value="2014" selected>2014</option><option value="2013">2013</option><option value="2012">2012</option> </select>
</form>
<button onclick="location.href='?view=list&month=October&year=2014'">Next</button>

最佳答案

button,
form {
display: inline-block;
}
<button onclick="location.href='?view=list&month=August&year=2014'">Prev</button>
<form action="index?view=list" class="pure-form pure-form-aligned" style="margin:20px;">
<input type="hidden" name="view" value="list" />
<select name="month" onchange="this.form.submit();">
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September" Selected>September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
<select name="year" onchange="this.form.submit();">
<option value="2014" selected>2014</option>
<option value="2013">2013</option>
<option value="2012">2012</option>
</select>
</form>
<button onclick="location.href='?view=list&month=October&year=2014'">Next</button>

关于html - 表单和其他按钮不会内联显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27391420/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com