10
0
fengchuanyu 9 сар өмнө
parent
commit
43f09be6c7

+ 62 - 0
2_css/练习9_盒模型.html

@@ -0,0 +1,62 @@
+<!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>
+        .container{
+            width: 400px;
+            border:3px solid #007bff;
+            border-radius: 10px;
+            padding:10px 30px;
+            margin:10px;
+        }
+        .img-content img{
+            width: 400px;
+            border-radius: 10px;
+        }
+        .text-content p{
+            color: #999;
+        }
+        .list-content ul{
+            padding: 0;
+        }
+        /* .list-content li{
+            width: 390px;
+            list-style: none;
+            background-color: #999;
+            margin-bottom: 10px;
+            padding:10px 0 10px 10px;
+            border-radius: 10px;
+        } */
+        .list-content li{
+            list-style: none;
+            background-color: #999;
+            margin-bottom: 10px;
+            border-radius: 10px;
+            padding: 10px 0 10px 10px;
+        }
+    </style>
+</head>
+<body>
+    <div class="container">
+        <div class="nav-content">
+            <h2>盒子 1</h2>
+        </div>
+        <div class="img-content">
+            <img src="./img/img1.jpg" alt="图片">
+        </div>
+        <div class="text-content">
+            <p>这是盒子 1 中的详细描述。这里可能包含更多的文字内容,以展示内边距的效果。</p>
+        </div>
+        <div class="list-content">
+            <ul>
+                <li>特点1</li>
+                <li>特点2</li>
+                <li>特点3</li>
+            </ul>
+        </div>
+    </div>
+</body>
+</html>