javascript - 选择标签的 SCSS 样式仅在移动设备上不起作用
问题描述
我的 Web 应用程序具有用于输入和选择元素的 SCSS 样式,但由于某种原因,尽管在计算机上正确显示,但该样式未在移动设备上显示。有谁知道为什么会这样?下面的 CSS 代码
.text-input {
background: $dark-grey;
border: 1px solid $off-white;
color: $off-white;
font-size: $font-size-medium;
font-weight: 300;
margin: 0 auto $s-size auto;
max-width: 100%;
padding: $s-size;
width: 90rem;
}
.text-input::placeholder {
color: $off-white;
}
.select {
@extend .text-input;
}
解决方案
添加 webkit-外观
.text-input {
background: $dark-grey;
border: 1px solid $off-white;
color: $off-white;
font-size: $font-size-medium;
font-weight: 300;
margin: 0 auto $s-size auto;
max-width: 100%;
padding: $s-size;
width: 90rem;
-webkit-appearance:none; // add this to add custom design cross-browser
}
.text-input::placeholder {
color: $off-white;
}
.select {
@extend .text-input;
}
推荐阅读
- unity3d - 适用于 iOS 的 Unity 构建 - 构建成功但没有任何反应
- .net - 无法让 Kestrel 开始使用 .NET 5.0 和 Linux Docker
- python - 将 unicode 格式字符串转换为实际的 utf 字符串
- python - 如何为 mrJobs 中的多行输入编写自定义协议
- jmeter - 使用 JMeter 对使用终极线程组的动态 365 电子商务网站进行性能测试。如何增加并发会话?
- python - 使用 python pandas 解析 CSV 列包含字符串和 JSON 的混合值
- json - 如何将json文件解析为对象类中的数组?
- django - Django:按多级反向查找排序
- reactjs - 如何按需导入 Ant 设计以使用进行解构的组件?
- jquery-ui - 在非空字段上设置 jQuery UI 日期选择器上的 dateFormat