fengchuanyu 10 months ago
parent
commit
1bfc909c03
5 changed files with 96 additions and 0 deletions
  1. BIN
      2_css/.DS_Store
  2. 25 0
      2_css/19_背景图.html
  3. BIN
      2_css/img/img5.jpg
  4. BIN
      2_css/img/zfb.png
  5. 71 0
      2_css/练习13_两列布局.html

BIN
2_css/.DS_Store


+ 25 - 0
2_css/19_背景图.html

@@ -0,0 +1,25 @@
+<!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>
+        .box{
+            width: 200px;
+            height: 400px;
+            border:2px solid black;
+            background-image: url("./img/zfb.png");
+            background-repeat: no-repeat;
+            /* background-size: 100%; */
+            /* background-size: 10px 100px; */
+            /* background-size: contain; */
+            background-size: cover;
+
+        }
+    </style>
+</head>
+<body>
+    <div class="box"></div>
+</body>
+</html>

BIN
2_css/img/img5.jpg


BIN
2_css/img/zfb.png


+ 71 - 0
2_css/练习13_两列布局.html

@@ -0,0 +1,71 @@
+<!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>
+        body{
+            margin: 0;
+        }
+        .nav-content{
+            background-color: blue;
+            padding: 20px;
+            color: white;
+        }
+        .foot-content{
+            background-color: #999;
+            padding: 20px;
+        }
+        .main-content::after{
+            content: "";
+            display: block;
+            clear: both;
+        }
+        .left,.center,.right{
+            float: left;
+            height: 200px;
+        }
+        .left{
+            width: 20%;
+            background-color: green;
+            overflow: hidden;
+        }
+        .center{
+            width: 60%;
+            background-color: red;
+            overflow: hidden;
+        }
+        .right{
+            width: 20%;
+            background-color: yellow;
+            overflow: hidden;
+        }
+    </style>
+</head>
+<body>
+    <div class="container">
+        <div class="nav-content">
+            <h1>我的网页</h1>
+        </div>
+        <div class="main-content">
+            <div class="left">
+                <h2>左侧边栏</h2>
+                <p>这是左侧边栏的内容。</p>
+            </div>
+            <div class="center">
+                <h2>主要内容</h2>
+                <p>这是网页的主要内容区域,您可以在这里添加大量的文本、图片或其他元素。</p>
+                <p>比如,这是一段额外的描述性文字,用于展示内容的丰富性。</p>
+            </div>
+            <div class="right">
+                <h2>右侧边栏</h2>
+                <p>这里可以放置一些右侧边栏的内容,比如广告、最新动态或相关链接。</p>
+            </div>
+        </div>
+        <div class="foot-content">
+            <span>版权所有 © 2024 我的网页</span>
+        </div>
+    </div>
+</body>
+</html>