此問題是從my previous question開始的後續操作。
我有一些從this website使用的風格,以創建下劃線效果幻燈片,請參閱此示例jsfiddle。 我之前的問題是詢問如何調整它,以便線條從右到左進行調整,並且在文本上方,請參閱jsfiddle上的示例。在文本上方和下方添加換行
我的下一步是將這兩個元素添加到一個元素中,所以一行從左到右滑動到底部,另一個從右到左滑動到頂部。
當我試圖將這兩個加在一起時,它似乎只顯示頂部,請參閱此jsfiddle。
我的問題是如何添加行中的頂部幻燈片和行中的底部幻燈片?
.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;
}
.cmn-t-overline {
position: relative;
color: #ff3296;
}
.cmn-t-overline:after {
display: block;
position: absolute;
right: 0;
top: -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-overline:hover {
color: #98004a;
}
.cmn-t-overline:hover:after {
width: 100%;
\t height:2px;
}
<h1 class="cmn-t-underline cmn-t-overline">Test</h1>