效果圖: html: <div class='site_bar'>首頁</div> css: .site_bar{ background-image : linear-gradient(red,red); background-position : center bottom; background ...
效果圖:
html:
<div class='site_bar'>首頁</div>
css:
.site_bar{
background-image : linear-gradient(red,red);
background-position : center bottom;
background-size : 0 2px;
background-repeat : no-repeat; //這個屬性不能少。
transition : .3s;
}
.site_bar:hover{
background-size : 100% 2px;
}