html - 输入字段文本,仅在 IOS 上更改样式

标签 html ios css mobile input

我有一个问题,我的输入字段中的文本看起来像这样,但仅限于 IOS。当我开始在字段中输入时,一切正常..

image of problem

它看起来不错,在 android 和桌面上,只有 ios 似乎会导致问题。

解决此问题的任何提示将不胜感激。

代码:

html:

<div class="search-overlay">
        <div class="search-input" role="search">
            <input placeholder="Søg på titel" name="query" data-quick-search="" id="search-programs-input"
                type="text" class="" value="" autocomplete="off"><button type="submit" class="dr-icon-search search-input-icon form-control-feedback"><span class="sr-only">{{dictionary "search" "Title"}}</span></button>
            <button type="button" class="close close-search" data-quicksearch-close=""><span class="dr-icon-close" aria-hidden="true"></span><span class="sr-only">{{dictionary "mainNavigation" "closeSearch"}}</span></button>

        </div>
    </div>

样式:

.search-overlay {
    background-color: white;
    height: 75px;
    position: absolute;
    top: -75px;
    width: 500px;
    right: 5px;
    z-index: 900;
    border: 1px solid #ccc;
    .search-input {
        padding: 15px;
        padding-left: 20px;
        input {
            background: #E5E5E5;
            width: 92%;
            font-size: 24px;
        }
        button {
            border: none;
            background: transparent;
            &[class*=dr-icon-search] {
                position: absolute;
                right: 55px;
                top: 23px;
                &:before {
                    font-size: 25px;
                    color: gray;
                }
            }
            .dr-icon-close {
                position: absolute;
                right: 14px;
                top: 23px;
                &:before {
                    font-size: 15px;
                    color: gray;
                }
            }
        }
    }

}

最佳答案

在我的输入中添加 Line-height:24px; 解决了这个问题...

关于html - 输入字段文本,仅在 IOS 上更改样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42788095/

相关文章:

jquery gif 加载器不会淡出

css - 不确定是使用 Flexbox、表格还是行和列

iphone - 离线保存网页以便稍后在 iOS 上阅读

ios - 如何得到一个 `NSURL`的文件目录?

jquery - 如何设置事件的 jQuery 菜单项

html - 样式化输入类型 ="file"按钮

html - 用文本包裹 anchor 元素

javascript - HTML如何在提交之前验证数组中的任何复选框

ios - Objective-c:自定义键盘/输入 View 上的 Siri

jquery - 带有按钮的简单 AddClass 和 RemoveClass,jQuery 脚本