html - 使用 dojo/html/css 实现搜索栏/按钮?

标签 html css search dojo

我正在尝试将我的搜索栏设计得更现代。目前我的搜索看起来像: enter image description here

我使用以下 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 有问题。有什么想法吗?

enter image description here

最佳答案

您可以允许现代浏览器使用 input type="search."处理搜索输入的呈现。

示例和教程:
http://www.wufoo.com/html5/types/5-search.html
http://diveintohtml5.info/forms.html#type-search

W3C 规范: http://www.w3.org/TR/html-markup/input.search.html

关于html - 使用 dojo/html/css 实现搜索栏/按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17795741/

相关文章:

javascript - 在图像悬停时显示文本而不是光标

javascript - HTML jQuery 平滑滚动到元素并添加类

html - CSS:两个背景图像在一个元素上的位置

html - 同一行的两个div

php - 在ElasticSearch中搜索

Swift - 在 UITableView 中搜索

html - 如何在包含可缩放图像的固定 div 下定位流中的 div

javascript - 单选按钮的自定义 iCheck 设计可防止单击时输出总价

css - 使两个 float 的 CSS 元素具有相同的高度

java - elasticsearch - 返回字段的标记