首页 > 其他分享 >前端疑问1

前端疑问1

时间:2023-02-26 20:15:10浏览次数:33  
标签:color 前端 100px height width yeye son 疑问

 

1,如果想给盒子添加高度和宽度,默认是向哪个方向添加

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .son {
            position: absolute;
            width: 100px;
            height: 100px;
            background-color: pink;
        }
        .yeye {
            position: relative;
            width: 300px;
            height: 300px;
            background-color: rgb(148, 162, 162);
            margin: 100px auto;
        }
        .yeye .son:hover {
            width: 200px;
            height: 200px;
        }
    </style>
</head>
<body>
    <div class="yeye">
        <div class="son"></div>
    </div>
</body>
</html>

 

标签:color,前端,100px,height,width,yeye,son,疑问
From: https://www.cnblogs.com/zhtw/p/17157498.html

相关文章