在iOS(Safari 5)上,我必须对输入元素(顶部内部阴影)执行以下操作:

示例

我要删除顶部阴影,错误-webkit-appearance无法保存.

当前样式为:

input {    
    border-radius: 15px;
    border: 1px dashed #BBB;
    padding: 10px;
    line-height: 20px;
    text-align: center;
    background: transparent;
    outline: none;    
    -webkit-appearance: none;
    -moz-appearance: none;
}

推荐答案

您需要使用-webkit-appearance: none;来覆盖默认的IOS样式.然而,仅 Select CSS中的input标签将不会覆盖默认IOS样式,因为IOS通过使用属性 Select 器input[type=text]添加其样式.因此,您的CSS将需要使用属性 Select 器来覆盖已预先设置的默认iOS CSS样式.

Try this:

input[type=text] {   
    /* Remove First */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Then Style */
    border-radius: 15px;
    border: 1px dashed #BBB;
    padding: 10px;
    line-height: 20px;
    text-align: center;
    background: transparent;
    outline: none;    
}

Helpful Links:

You can learn more about 100 here:

100

If you'd like to learn more about CSS attribute selectors, you can find a very informative article here:

100

Css相关问答推荐

如何获得特定位置的Divs以根据浏览器宽度正确调整大小

如何居中对齐容器父对象?

导航栏没有使用nextui获取页面的全部宽度

如何使用混合混合模式更改动画背景上的文本 colored颜色

滚动弹性盒

SASS 中的计算表达式

如何使用props 为 Vue 中的组件创建动态背景图像?

为什么每次加载新页面时我的 React 侧边栏都会抖动?

在不使用 position: fixed 的情况下从 CSS 网格中的自动布局中免除子元素?

我怎样才能将我的按钮向上移动,因为文本是

不同的背景 colored颜色 取决于 URL

使用 styled-components,我如何定位组件的子类?

如何在 Angular 中使用 CSS 设置 FontAwesome 图标的大小?

当计算的宽度不准确时,如何在 cypress 中测试元素的宽度?

CSS如何防止键盘向上移动内容?

如何更改下拉列表的宽度?

如何在没有填充区域的情况下背景化 div

如何在渲染之前获取react 组件的大小(高度/宽度)?

当子元素水平溢出时,为什么忽略父元素的右填充?

bootstrap.css 和 bootstrap-theme.css 有什么区别?