将文本输入和提交按钮设置为内联样式
我想请您提供提示,如何设计内联的文本输入和提交按钮的样式,特别是 - 我的模式看起来 这个:
以及现实 这个
在我的代码中:
<form accept-charset="UTF-8" action="/home/index" method="post">
<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="✓" />
</div>
<input class="search" data-autocomplete="/home/autocomplete_produkties_nazev" id="name" name="nazev" type="text" value="" />
<input src="/images/search_btn.jpg?1308243954" type="image" />
</form>
在 CSS 中:
input.search {
padding: 6px;
width: 500px;
font-size: 15px;
border: 2px solid #cfcfcf;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
background-image: url('/images/xxx.png');
background-repeat: repeat-x;
height: 61px;
}
我正在尝试获取以及如何修复,提交按钮始终高于文本输入按钮...我不知道,在哪里可以是一个问题...有人可以给我一些提示或提示,如何将文本输入和提交按钮放在同一行?
谢谢
I would like to ask you for a hint, how to style my text input and submit button that will be inline, especially - my pattern looks this:
And the reality this
In code I have:
<form accept-charset="UTF-8" action="/home/index" method="post">
<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="✓" />
</div>
<input class="search" data-autocomplete="/home/autocomplete_produkties_nazev" id="name" name="nazev" type="text" value="" />
<input src="/images/search_btn.jpg?1308243954" type="image" />
</form>
And in CSS:
input.search {
padding: 6px;
width: 500px;
font-size: 15px;
border: 2px solid #cfcfcf;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
background-image: url('/images/xxx.png');
background-repeat: repeat-x;
height: 61px;
}
I am trying to get and how to repair, that the submit button is always above than text-input button... I don't know, where could be a problem... could be someone give me some tips or hint, how to place on the same line text-input and submit button?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试将搜索输入向左浮动,将提交按钮向右浮动: http://jsfiddle.net/ianoxley/ FEQhb/1/
You could try floating the search input left and the submit button right: http://jsfiddle.net/ianoxley/FEQhb/1/