CSS3 transform与absolute宽度100%实例页面
回到相关文章 »代码:
CSS代码:
.demo { position: relative; } .container { width: 191px; height: 191px; border: 2px solid #beceeb; } .container img { position: absolute; height: 191px; width: 100%; } .transform { -webkit-transform: scale(1); -ms-transform: scale(1); transform: scale(1); }
HTML代码:
<p><strong>容器不含transform</strong></p> <div class="container"> <img src="mm1.jpg" /> </div> <p><strong>容器transform</strong></p> <div class="container transform"> <img src="mm1.jpg" /> </div>
效果:
容器不含transform
容器transform