html+css实战116-体验行内块问题

<!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>
        div {
            /* 浏览器解析行内块或行内标签的时候, 如果标签换行书写会产生一个空格的距离 */
            display: inline-block;
            width: 100px;
            height: 100px;
        }

        .one {
            background-color: pink;
        }

        .two {
            background-color: skyblue;
        }
    </style>
</head>
<body>
    <div class="one">one</div><div class="two">two</div>
</body>
</html>

运行结果

猜你喜欢

转载自blog.csdn.net/geyaoisnice/article/details/125116480