简体   繁体   English

灰线出现在我在iPhone上的输入字段中

[英]Grey line appears in my input field on iPhone

I have an input that has a weird gray line, but only on iPhone. 我的输入有一条奇怪的灰线,但仅在iPhone上。 It is a solid white input on non-mobile browsers. 在非移动浏览器上为纯白色输入。 I do not have android so I am not able to test if it is iPhone only. 我没有android,所以我无法测试它是否仅是iPhone。 Any solutions to make the input entirely white? 有什么解决方案可以使输入完全变为白色?

输入灰线图像

HTML: HTML:

<input class="bt-email" type="email" name="email" placeholder="enter email address">
<input class="bt-submit" type="submit" value="let's get moving!">

CSS: CSS:

.bt-email {
   color: #1795db;
   display: inline-block;
   margin: 0 auto;
   height: 30px;
   font-family: 'Lato', serif;
   font-weight: 300;
   padding-left: 15px;
   text-decoration: none solid rgb(56, 64, 71);
   width: 90%;
   background: #ffffff;
   border: 4px solid #ffffff;
   border-radius: 5px 5px 5px 5px;
}
.bt-email:focus {
   outline: #ffffff;
}
.bt-submit {
   color: #ffffff;
   display: inline-block;
   margin: 0 auto;
   height: 40px;
   font-family: 'Lato', serif;
   font-weight: 300;
   text-decoration: none solid rgb(56, 64, 71);
   width: 90%;
   padding-top: 4px;
   background: #fb7f2d;
   border: 1px solid #fb7f2d;
   border-radius: 5px 5px 5px 5px;
 }

I have actually stumbled upon the answer I was looking for. 我实际上偶然发现了我想要的答案。 It appears mobile Safari adds an inner-text shadow to inputs. 似乎移动Safari在输入中添加了内部文本阴影。 This code solved it: 这段代码解决了它:

CSS: CSS:

-webkit-appearance: none;

Related question that solved my issue 解决了我的问题的相关问题

Try removing the 4px border and just add 尝试删除4px边框,然后添加

 padding:4px;

Instead by adding it to the existing padding 而是通过将其添加到现有填充中

Yes, Pretty simple. 是的,非常简单。

Just try 你试一试

input {-webkit-appearance: none;}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM