【问题标题】:Blurry / pixelated borders in FirefoxFirefox 中的模糊/像素化边框
【发布时间】:2022-02-15 05:24:29
【问题描述】:

基本上我的问题是,只要应用了“transform:scale”属性的元素,Firefox 就会渲染弯曲的边框真的很模糊/像素化。

如果属性 "border" 、 "border-radius" 和 "transform:scale" 应用于元素,则生成的弯曲边框实际上是像素化的,但仅在 Firefox 中。

CSS:

.element {
   transform: scale(0.25);
   border: 5px solid black; 
   border-radius: 40px;
}

** 此问题仅出现在移动版 Firefox 上。

【问题讨论】:

    标签: html css transform


    【解决方案1】:

    使用transform: scale3d(0.25) 而不是transform: scale(0.25)

    在 Firefox 和 Chrome 中测试。

    .element {
      transform: scale3d(0.25);
      border: 5px solid black;
      border-radius: 40px;
    }
    <div class="element">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up
      one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorumet
      Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
    </div>

    【讨论】:

    • 谢谢,但是有没有其他方法可以使这项工作,因为我实际上并没有将“转换”应用于特定元素,而是使用“初始比例:0.25”应用于整个页面" 视口属性。
    • @BlaineO'neill 对您的意思感到困惑。您说您不想将转换应用于元素,但将其在 CSS 中列为.element。进一步详细说明。
    • 我在这里问了一个更详细的问题。 stackoverflow.com/questions/71123245/…
    猜你喜欢
    • 1970-01-01
    • 2018-01-21
    • 1970-01-01
    • 2015-12-17
    • 1970-01-01
    • 1970-01-01
    • 2014-06-29
    • 1970-01-01
    • 2013-12-22
    相关资源
    最近更新 更多