【问题标题】:How to target multiple browsers in Angular 11 project using scss如何使用 scss 在 Angular 11 项目中定位多个浏览器
【发布时间】:2021-05-19 18:23:58
【问题描述】:

例如: 我正在为 ::focus 上的 ::placeholder 伪元素设置动画

  input::placeholder{
       color: grey;
       transition: all 400ms ease;
       position: absolute;
       top: 35%;
       font-size: 15px;
  }

   input:focus::placeholder{
       color: green;
       top: 0%;
       font-size: 10px;
       position: relative;
  }

在 Chrome 中它工作得很好,但在 Firefox 和 Safari 中不起作用, 任何人都可以帮忙,我真的需要能够做到。谢谢

【问题讨论】:

    标签: css angular sass


    【解决方案1】:

    您可以使用供应商前缀来完成您想要的。

    在给定的示例中,要使用 Firefox,您应该使用 ::-moz-placeholder

    您可以找到更多关于供应商前缀here

    【讨论】:

      【解决方案2】:

      我想你只需要将 firefox 支持添加到 .browserslistrc 文件即可。

      【讨论】:

        猜你喜欢
        • 2020-09-14
        • 2016-10-12
        • 2020-11-04
        • 2018-07-13
        • 2022-12-15
        • 2022-10-23
        • 2020-08-12
        • 2015-10-21
        • 1970-01-01
        相关资源
        最近更新 更多