怎么实现一个正方形,它的宽是屏幕的20%
<style>
*{margin:0;padding:0;}
.demo1{width:20%;background: red; padding-top: 20%;}
.demo2{width: 20%;height:20vw;background: blue;}
</style>
<div class="demo1"></div>
<div class="demo2"></div>
怎么实现一个正方形,它的宽是屏幕的20%
<style>
*{margin:0;padding:0;}
.demo1{width:20%;background: red; padding-top: 20%;}
.demo2{width: 20%;height:20vw;background: blue;}
</style>
<div class="demo1"></div>
<div class="demo2"></div>
本文标题:css实现正方形
本文链接:https://www.haomeiwen.com/subject/ohtkwqtx.html
网友评论