<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<style type="text/css">
.div{
background: red;
width: 20%;
overflow: hidden;
}
.div:after{
content: '';
display: block;
margin-top: 100%;
}
</style>
<body>
<div class="div"></div>
</body>
</html>
css实现高度自适应正方形
猜你喜欢
转载自blog.51cto.com/12173069/2299007
今日推荐
周排行