我使用this website上发现的某种样式创建下划线幻灯片。例如,请参阅jsfiddle。
正如你所看到的,下划线从左到右。我将如何去在文本的顶部制作另一行,从右向左转换?我可以简单地调整我的当前代码片段,还是必须完全使用其他方法?使下划线CSS过渡更改方向
.cmn-t-underline {
position: relative;
color: #ff3296;
}
.cmn-t-underline:after {
display: block;
position: absolute;
left: 0;
bottom: -10px;
width: 0;
height: 10px;
background-color: #2E9AFE;
content: "";
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
height:2px;
}
.cmn-t-underline:hover {
color: #98004a;
}
.cmn-t-underline:hover:after {
width: 100%;
\t height:2px;
}
<h1 class="cmn-t-underline">Test</h1>
不错的工作。我想这与转换类型有关。 –