css实现高度自适应正方形
更新:HHH   时间:2023-1-7


<!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>
返回web开发教程...