|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
今天发现的一个很有趣的问题
- <!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>
- *{
- margin: 0;
- padding: 0;
- }
- div.box1{
- width: 300px;
- /* height: 200px; */
- background-color: red;
- }
- div.box2{
- width: 100px;
- height: 150px;
- background-color: greenyellow;
- }
- div.box3{
- width:60px;
- height: 50px;
- background-color: aqua;
- margin-top: -1px; /* 尝试变换这个值 */
- }
- </style>
- </head>
- <body>
- <div class="box1">
- <div class="box2"></div>
- <div class="box3"></div>
- </div>
- <p>这是一段文字</p>
-
- </body>
- </html>
复制代码 |
|