css - 输入类型="search"元素里面增加放大镜图标

标签 css html jquery-mobile

Hello, how can i increase the "size" of the magnifying glass Icon inside the input type="search" element. I am using jQueryMobile.

到目前为止我试过这个:

.ui-input-text input, .ui-input-search input{
    font-size: 24px !important;
    height: 60px !important;
}

.ui-icon-search:after{
    font-size: 300px !important;
    width: 200px !important; 
}

我的 FIDDLE .

不幸的是,即使使用浏览器检查器,我也找不到更多信息。

最佳答案

您的选择器(.ui-input-search:after 是正确的)是错误的,它是背景图像而不是字体图标,因此字体大小不会影响显示放大图标。

下面应该让您了解它是如何工作的:

.ui-input-search:after{
    display: block;
    width: 30px !important;
    height: 30px !important;
    background-size: contain;
}

关于css - 输入类型="search"元素里面增加放大镜图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40505516/

相关文章:

html - 内联导航示例不起作用

jquery - IE7 Jquery 位置 : Relative

javascript - 我在 Angular HTML 模板中做错了什么?

php - 如何使用 html 表单提交多个数组复选框

android - 使用 jQuery Mobile 和 Phonegap 在 Galaxy S2 上使用键盘输入错误

javascript - 有没有办法设置 slimbox 弹出窗口的最小宽度?

css - 外部字体无法正确加载 CSS

javascript - 在 iPad 上,html 5 视频标签的 src 属性中的 http url 不起作用

android - 在 iOS/Android 原生媒体播放器中播放 HTML5 视频

javascript - 通过ajax过滤列表并请求数据