我怎样才能使用百分比使这个响应或流畅?这样我就不必给它一个固定的像素宽度
示例 - http://codepen.io/anon/pen/kiveg
HTML
<ul>
<li><a href='#'><span><img src="http://lorempixel.com/400/400/" alt="" /></span></a></li>
<li><a href='#'><span><img src="http://lorempixel.com/400/400/" alt="" /></span></a></li>
<li><a href='#'><span><img src="http://lorempixel.com/400/400/" alt="" /></span></a></li>
<li><a href='#'><span><img src="http://lorempixel.com/400/400/" alt="" /></span></a></li>
</ul>
CSS
li {
background: none;
display: inline-block;
*display: inline;
zoom: 1;
list-style: none;
margin: 0;
padding: 0;
width: 137px;
height: 137px;
}
a {
background: #FFFFFF;
border: 3px solid #cbccce;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
overflow: hidden;
display: block;
width: 100px;
height: 100px;
margin: 25px auto;
position: relative;
}
li span {
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
width: 150px;
height: 150px;
margin: -25px;
display: block;
position: relative;
}
img {
max-width: 100%;
display: block;
opacity: 0.9;
}
基于:http: //viget.com/inspire/who-says-the-web-is-just-for-squares