【问题标题】:CSS - Blurry text after scale an elementCSS - 缩放元素后的模糊文本
【发布时间】:2018-09-01 20:55:10
【问题描述】:

我正在尝试将 scale 动画应用于引导按钮,但它的文本模糊。我尝试了here 发布的每个答案。我该如何解决?
这是代码(它在 sn-p 中显示的模糊度比在我的项目中要少):

button.btn-outline-dark{
    margin-top: 6%;
    width:30%;
    height: 17%;
    color: black;
}
button.btn-outline-dark:hover{
    transition: all .2s ease-in-out;
    transform: scale(1.1);
    -webkit-font-smoothing: subpixel-antialiased;
    backface-visibility: hidden;    
    -webkit-filter: blur(0);
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">


<button type="button" class="btn btn-outline-dark" data-toggle="modal" data-target="#exampleModal">
    Blurry Text
</button>

【问题讨论】:

标签: html twitter-bootstrap css bootstrap-4


【解决方案1】:

正如我在评论中所说,这里是使用缩放来获得相同效果的替代方法:

button.btn-outline-dark{
    margin-top: 6%;
    color: black;
    transition:0.5s;
    padding: 10px 40px;
    font-size:14px;
}
button.btn-outline-dark:hover{
    font-size:20px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>

<button type="button" class="btn btn-outline-dark" data-toggle="modal" data-target="#exampleModal">
    Blurry Text - Not Anymore
</button>

显然,它可能需要一些调整才能让您的确切样式需求正确,但应该可以正常工作。

【讨论】:

  • 这种效果在 Chrome 中看起来很糟糕。非常紧张。
  • 我同意,那你为什么不展示如何正确地做呢?
猜你喜欢
  • 2014-08-16
  • 2019-11-11
  • 2015-12-23
  • 2019-12-24
  • 1970-01-01
  • 2011-07-18
  • 1970-01-01
  • 2015-11-06
  • 2020-08-27
相关资源
最近更新 更多