html - CSS边界属性,奇怪的行为
问题描述
我正在修改我拥有的联系表单的文本字段输入的样式。我想要的样式只是底部边框,它似乎适用于 chrome 但不适用于移动设备的 Safari,整个边框仍然可见。请参阅下面的图片以供参考。
Chrome Version 91.0.4472.114 (MacOS)
Chrome 工作并且看起来不错。
在我的手机上,通过屏幕截图很难看到边框的一些顶角是可见的,而底部边框是弯曲的。
css
export const TextField = styled.input`
width: 100%;
background: #131d32;
border: none;
border-bottom: 1px solid rgba(200, 200, 200, 0.7);
min-height: 35px;
color: white;
outline: 0;
border-width: 0 0 2px;
:focus {
border-width: 0 0 1px;
}`;
解决方案
请设置border-radius为0;
export const TextField = styled.input`
width: 100%;
background: #131d32;
border: none;
border-bottom: 1px solid rgba(200, 200, 200, 0.7);
min-height: 35px;
color: white;
outline: 0;
border-width: 0 0 2px;
border-radius: 0;
:focus {
border-width: 0 0 1px;
}`;
推荐阅读
- angular - 从 prime-ng 下拉列表中获取选定的文本
- android - Android R8 - 缺少类:com.sun.javadoc.Doclet
- azure - 我们可以通过 Azure DataFactory 从 RestAPi 中提取增量数据吗?
- windows - 如何用行号替换任何行?
- r - 如何在r中捕获非序列数的范围
- php - 如果当前日期等于该月的最后一天,则每月添加一次数据
- html - 如何在 HTML5 设计中添加富文本框,并且我想像其他文本框一样圆角?
- node.js - Mongoose post Query Middleware hook trigger 两次
- kotlin - Intellij 无法导入 Java 库以与 Kotlin 一起使用
- spring-boot - 无法在 Spring Boot 上启动 Tomcat 嵌入