首页 > 解决方案 > 应用于 Apple IOS 设备上的输入的不可见边框

问题描述

输入在 iOS 设备和所有浏览器上都应用了几乎不可见的边框。

如何删除或阻止应用此样式?

const StyledInputString = styled.input`
    width: 40%;
    background: #fff;
    font-size: 18px;
    color: #8f8fa1;
    line-height: 1.2;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    border: none;
    border-bottom: 1px solid black;
    padding-left: 20px;
    height: 56px;
    margin-bottom: 20px;
    &:focus {
      border-bottom: 2px solid #03a900;
      color: black;
    }

应用了样式的示例图像:

在此处输入图像描述

标签: javascriptcssiphonereactjs

解决方案


尝试使用border-radius属性。

input {
    border-radius: 0;
}

也尝试设置

input {
    -webkit-appearance: none;
}

推荐阅读