本文介绍了规模:在徘徊之前的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在悬停时缩放我的< span> 内容<: 到目前为止,悬停时应用的样式不存在视觉上的变化,:before 保持相同的比例。
I'm trying to scale the :before content of my <span> when hovering over it. So far the style gets applied when hovering but there are no visual changes, the :before remains the same scale.
到目前为止:
<div class="comment-actions"> <span class="comment-likes icon-ico-heart"> 12 </span> </div>
SASS(CSS):
.comment-likes transition: all 100ms ease-in-out color: #92a3b9 cursor: pointer &:hover::before transform: scale(1.5)
Icomoon:
.icon-ico-heart:before { content: "\e914"; } [class^="icon-"], [class*=" icon-"] { /* use !important to prevent issues with browser extensions that change fonts */ font-family: 'icomoon' !important; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
推荐答案
scale属性,但使用font-size。所以:
Don't transform it with the scale property but use the font-size. So:
.icon-ico-heart:hover:before { font-size: 20px; }
这篇关于规模:在徘徊之前的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!