【发布时间】:2012-06-24 02:53:12
【问题描述】:
当<div> 悬停在上面时,我正在尝试使用 CSS3 过渡使 <div> 中的图像向上移动 10 个像素。它在 Firefox 中运行良好,但是当我在 Chrome 和 Safari 中查看它时,<h3> 和 <p> 元素上下抖动了一下。
这是我的 CSS:
.feature-table #box {
width: 325px;
height: 372px;
margin-right: 20px;
float: left;
}
.feature-table a {
display: block;
width: 325px;
height: 372px;
}
.feature-table a img {
display: block;
margin-left: auto;
margin-right: auto;
padding-top: 54px;
padding-bottom: 40px;
-moz-transition: all 0.3s linear;
-webkit-transition: all 0.3s linear;
transition: all 0.3s linear;
}
.feature-table a: hover img {
padding-top: 44px;
padding-bottom: 50px;
}
.feature-table a h3 {
font-family: 'GothamBold', sans-serif;
font-size: 30px;
color: #3d3d3d;
text-align: center;
text-decoration: none;
margin: 0;
padding: 0 25px;
}
.feature-table a: hover h3 {
color: #f6ce4f;
}
.feature-table a {
text-decoration: none;
}
.feature-table p {
font-family: 'GothamLight', sans-serif;
font-size: 14.5px;
color: #949494;
text-align: center;
padding: 10px 28px;
}
.feature-table .caret {
border-top: 5px solid #fff;
border-bottom: 5px solid #fff;
border-left: 5px solid #ffc235;
content: "";
display: inline-block;
height: 0;
width: 0;
margin-left: 10px;
}
这是我的 HTML 的一部分:
<div id="box">
<a href="#">
<img src="images/payment_icon.png" width="114" height="115" border="0" />
<h3>Customizable Campaign Pages</h3>
<p>Tell your story with images, video, rich text and social updates<b class="caret"></b></p>
</a>
</div>
有什么想法吗?
【问题讨论】:
标签: html css css-transitions