HTML/CSS 如何进行标签转换?

具体标签转换操作如下:

<!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>
        .box{
            width: 300px;
            height: 300px;
            background-color: blueviolet;
            display: inline-block;
        }
        .box02{
            background-color: yellowgreen;
            display: inline;

            width: 500px;
            height: 500px;
            /* 宽高设置无效 */
        }
    </style>
</head>
<body>
    <!-- 行内转块 -->
    <div>
        <span style="width: 300px; height: 300px; background-color: aquamarine; display: block;">123</span>
    </div>

    <!-- 行内转块 设置宽高,不换行 -->
    <div class="box">
        <span>1</span>
        <span>2</span>
    </div>

    <!-- 了解内容:块转行内 -->
    <div class="box02">
        <div>111</div>
        <div>222</div>
        <div>333</div>
    </div>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/m0_74744119/article/details/128871238