e 1 год назад
Родитель
Сommit
3216329d0c
2 измененных файлов с 131 добавлено и 0 удалено
  1. 37 0
      html/day4/5.css补充样式.html
  2. 94 0
      html/day4/6.浮动.html

+ 37 - 0
html/day4/5.css补充样式.html

@@ -0,0 +1,37 @@
+<!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>
+        div {
+            width: 400px;
+            height: 400px;
+            background-color: aqua;
+            /* border-radius: 50%; */
+            border-top-right-radius: 20px;
+            /* 
+                圆角边框:border-radius 
+                border-radius:50%;圆形
+                border-top-right-radius 右上角
+                border-top-left-radius 左上角
+                border-bottom-left-radius 左下角
+                border-bottom-right-radius 右下角
+            */
+        }
+        input {
+            border:1px solid #f00;
+            /* outline: none; */
+            /* 轮廓
+                outline:width style color;
+            */
+            outline: 3px solid #0f0;
+        }
+    </style>
+</head>
+<body>
+    <div></div>
+    <input type="text">
+</body>
+</html>

+ 94 - 0
html/day4/6.浮动.html

@@ -0,0 +1,94 @@
+<!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>
+      * {
+        margin: 0;
+        padding: 0;
+        list-style: none;
+        text-decoration: none;
+        box-sizing: border-box;
+      }
+      .box {
+        /* width: 1500px; */
+      }
+      .header {
+        width: 100%;
+        height: 75px;
+        background: #00f;
+      }
+      .header .nav {
+        width: 1200px;
+        height: 100%;
+        background: #ff0;
+        /* 已知宽高的盒子水平居中
+            auto 自适应
+        */
+        margin: 0 auto;
+      }
+      .header .nav ul li {
+        float: left;
+      }
+      .main div {
+        width: 200px;
+        height: 200px;
+        /* float: left; */
+      }
+      .main .one {
+        background: #f00;
+      }
+      .main .two {
+        background: #0ff;
+        float: left;
+      }
+      .main .three {
+        width: 400px;
+        height: 400px;
+        float: left;
+        background: #f0f;
+      }
+      .main .four {
+        height: 300px;
+        background: #0f0;
+      }
+    </style>
+  </head>
+  <body>
+      <!-- 
+            为什么要语义化?
+            1.高效、便携开发
+            2.搜索引擎寻找信息
+
+            想让标签在一行展示?
+            浮动:让元素在一行展示
+            float:left/right/none
+            特点:脱离文档流 不占位
+         -->
+    <div class="box">
+      <!-- 头部样式 -->
+      <div class="header">
+        <div class="nav">
+          <ul>
+            <li><a href="">内容1</a></li>
+            <li><a href="">内容2</a></li>
+            <li><a href="">内容3</a></li>
+            <li><a href="">内容4</a></li>
+            <li><a href="">内容5</a></li>
+          </ul>
+        </div>
+      </div>
+      <!-- 主体样式 -->
+      <div class="main">
+        <div class="one"></div>
+        <div class="two"></div>
+        <div class="three"></div>
+        <div class="four"></div>
+      </div>
+      <!-- 尾部样式 -->
+      <div class="footer"></div>
+    </div>
+  </body>
+</html>