html - 请问我如何让搜索框在(移动 View )中消失并且只搜索字形?

标签 html css bootstrap-modal

请问我如何让搜索框在(移动 View )中消失并且只有搜索字形?仅当按下放大镜/glyphicon-search 时才会出现搜索框?谢谢!

最佳答案

仅针对 search box 添加媒体查询和添加属性 display="none",对于搜索 glyphicon,您可以使用 display="block"。

按照这个示例:

CSS:

 @media only screen and (max-width: 600px) {
     .searchBox{
       display:none;
     }
     .searchIcon{
      display: block;
     }
 }

html:

<div>
 <input class="searchBox" type="search" name="searchBox" 
  placeholder="search">
 <span class="glyphicon glyphicon-search searchIcon"></span>
</div>

关于html - 请问我如何让搜索框在(移动 View )中消失并且只搜索字形?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49886878/

相关文章:

javascript - 尝试将 contenteditable div 的内容保存到 MySQL 数据库

javascript - 如何通过 jQuery 将 CSS 添加到类中?

html - 在 :after 的内容上换行

c# - ScriptManager.RegisterClientScriptBlock 不工作

javascript - 如何清除内容 - Bootstrap Modal

javascript - 无法在加载的模态中触发点击事件

php - CodeIgniter - 通过单击按钮将值从 View 传递到 Controller

javascript - modernizr CSS3 动画回退到 swf

javascript - 多级(下拉)菜单CSS JS

javascript - 使用 remove() 删除元素,但其属性仍然存在