【发布时间】:2014-12-11 18:03:32
【问题描述】:
有人可以帮我阻止这里的内部文本缩放吗?它让我头疼,几天来一直试图破解它。如果我们必须使用一些 jQuery 但没有插件,请不要介意。
CodePen 示例:http://codepen.io/anon/pen/EaKVQO
CSS:
.image-box{
width: 300px;
overflow:hidden;
}
.image {
text-align: center;
width:300px;
height:200px;
background: url("http://lorempixel.com/300/200");
background-position:center;
transition: all 1s ease;
-moz-transition: all 1s ease;
-ms-transition: all 1s ease;
-webkit-transition: all 1s ease;
-o-transition: all 1s ease;
transform: scale(1.2);
-moz-transform: scale(1.2);
-webkit-transform: scale(1.2);
-o-transform: scale(1.2);
-ms-transform: scale(1.2); /* IE 9 */
}
.image:hover {
transform: scale(1);
-moz-transform: scale(1);
-webkit-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1); /* IE 9 */
}
h2 {
padding: 10px 0 0 0;
}
h2, p {
margin: 0;
padding: 0;
transform: scale(0.8333);
-moz-transform: scale(0.8333);
-webkit-transform: scale(0.8333);
-o-transform: scale(0.8333);
-ms-transform: scale(0.8333); /* IE 9 */
}
HTML:
<div class="image-box">
<div class="image">
<h2>TITLE</h2>
<p>copy is here</p>
</div>
</div>
【问题讨论】:
-
这是来自同一用户的同一问题的重复。请根据需要编辑最初的问题。