首页 > 解决方案 > 如何在 JS 插件中现有的之上添加转换

问题描述

我正在使用插件 arctype.js,它允许您在页面上弯曲文本。但是,它使用转换,现在我无法使用 css 添加任何其他转换效果transform。这是我尝试过的代码:

<center><h2 id = "days" class = "numbers">1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 </h2></center>

 <style> 
    .numbers .char1{
        transform: translate(0px, 0);
        transition: -webkit-transform 0.8s ease;
    }

    .numbers .char1:hover{
      transform: scale(0.7);

    }
<style>

标签: javascripthtmlcss

解决方案


为了覆盖插件的 css 并确保您的样式声明始终获得最高优先级,您可以使用!important

.classname {
 transform: scale(0.7) !important;
}

推荐阅读