我正在尝试将我的搜索栏设计得更现代。目前我的搜索看起来像:
我使用以下 HTML 获得:
<div id="search">
<input type="text" id="parcel" size="30" value="Enter Parcel ID or Address"/>
<button data-dojo-type="dijit.form.Button" data-dojo-props='onClick:function(){ doFind();}'>Search</button>
</div>
和 CSS:
#search {
position:relative;
top:2px !important;
right: 95px;
color:white !important;
font-family:Goudy Old Style Italics;
font-weight:bold;
font-size:11pt;
}
我想将搜索栏修改为如下图所示,这样当用户单击该图标时,就会执行搜索。我已经尝试实现在谷歌上找到的一些解决方案,但我认为我的 CSS 有问题。有什么想法吗?
最佳答案
您可以允许现代浏览器使用 input type="search."处理搜索输入的呈现。
示例和教程:
http://www.wufoo.com/html5/types/5-search.html
http://diveintohtml5.info/forms.html#type-search
关于html - 使用 dojo/html/css 实现搜索栏/按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17795741/