之間生成動畫文本修飾我試圖創建一個div,當用戶將鼠標懸停在其上時,其內部的鏈接帶下劃線。現在我已經能夠使它工作,如果用戶懸停在鏈接本身上,它會創建動畫,但是我想在懸停在div上時觸發動畫。CSS:將光標懸停在div上,以便在
這可以用純CSS來完成嗎?或者我需要用Javascript調用它?
HTML:
<div class="module-link">
<label><a href="job_information.php">Job Information</a></label>
<img src="images/project.png"/>
</div>
CSS
.module-link{
font-family: futura-medium, Geneva, sans-serif;
font-size:20px;
float:left;
width:108px;
height:180px;
margin:20px;
padding:20px;
background: #CDCDCD;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border:1px solid #b1b1b1;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-ms-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}
.module-link:hover {
background: #EDEDED;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-ms-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}
.module-link label{
text-align:center;
font-variant: small-caps;
left:0;
right:0;
margin:auto;
display: block;
margin-bottom: 25px;
}
.module-link img{
left:0;
right:0;
margin:auto;
width:100px;
display: block;
}
.module-link a{
text-decoration:none;
color:#000;
display:inline;
}
.module-link a:after{
conent: '';
content: '';
display: block;
border-bottom: 1px solid #000;
width: 0;
-webkit-transition: 0.5s ease;
transition: 0.5s ease;
}
.module-link :hover:after { width: 100%; }
工作就像一個漂亮!謝謝泡沫 – Owen