我以前也这样做过,但目前它不起作用,我也不知道为什么。我希望第一个h1在悬停时稍微旋转一下。以下是我的代码
http://jsfiddle.net/YLXtd/1/
html
<div id="headLine">
<h1 class="fitText"><span class="highLight">Austin Kitson</span></h1>
<h2 class="fitText"><span class="highLight">Marketing & Sales</span></h2>
</div>
</section>css
#headLine {
position: relative;
top: 10em;
margin-left:auto;
margin-right:auto;
width:100%;
text-align:center;
}
#headLine .fitText {
-webkit-transition: 0.3s;
-moz-transition: 0.3s;
transition: 0.3s;
padding:1em;
}
#headLine .fitText:hover {
-moz-transform: rotate(3deg);
-ms-transform: rotate(3deg);
-o-transform: rotate(3deg);
transform: rotate(3deg); }
#headLine .highLight {
background: rgba(151, 173, 191, 0.7);
padding: 0.3em;
color: #ebe6e0; }
发布于 2012-12-28 18:52:47
使用以下代码:它在我身上起作用了
#headLine .fitText {
-webkit-transition: 1.5s all ease;
-moz-transition: 1.5s all ease;
-o-transition: 1.5s all ease;
transition: 1.5s all ease;
}
.fitText:hover {
-webkit-transform: rotate(3deg);
-moz-transform: rotate(3deg);
-o-transform: rotate(3deg);
transform: rotate(3deg);
}这里是链接http://jsfiddle.net/YLXtd/7/
https://stackoverflow.com/questions/14063147
复制相似问题