1. 主页
  2. 文档
  3. CSS
  4. 盒模型
  5. 行内元素和块级元素

行内元素和块级元素

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1{
            width: 100px;
            height: 100px;
            background-color: orange;
        }
        .box2{
            width: 100px;
            height: 100px;
            background-color: blue;
        }
        span{
            width: 100px;
            height: 100px;
            background-color: green;
        }
        img{
            width: 400px;
        }
        input{
            width: 200px;
            height: 100px;
        }
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="box2"></div>

    <span>我是span1</span>
    <span>我是span2</span>

    <div>
        <img src="images/0.jpg" alt=""><img src="images/0.jpg" alt="">
    </div>

    <div>
        <input type="text">
        <input type="text">
    </div>
</body>
</html>
这篇文章对您有用吗?

我们要如何帮助您?