【问题标题】:Buttons has no background on Safari iOS按钮在 Safari iOS 上没有背景
【发布时间】:2020-12-08 19:35:05
【问题描述】:

我在使用 Safari 中的 iOS 设备上的按钮时遇到问题,没有像在桌面设备和 Android 设备上那样应用背景颜色。 这是按钮上的 CSS 属性

export const Button = styled.button`
  display: inline-block;
  color: ${({ theme }) => theme.text.main};
  margin-left: 8px;
  padding: 0 15px;
  height: 32px;
  border-radius: 4px;
  background-color: ${({ theme }) => theme.palette.main};
  font-weight: 400;
  line-height: 1.5;
  font-size: 15px;
  cursor: pointer;

  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  opacity: 1;
`

【问题讨论】:

    标签: css reactjs safari mobile-safari


    【解决方案1】:

    您使用的是引导程序 .btn 吗? 然后尝试在您的 css 文件中使用背景或背景颜色。

    .btn{
      background: #fff;
    }
    

    【讨论】:

    • 这只是一个普通的 HTML 按钮。我在最初的问题中添加了完整的 CSS 属性列表
    猜你喜欢
    • 2015-07-15
    • 2021-05-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-25
    • 2013-07-12
    • 1970-01-01
    • 2023-03-22
    相关资源
    最近更新 更多