fengchuanyu 3 月之前
父節點
當前提交
59e785c039
共有 2 個文件被更改,包括 128 次插入0 次删除
  1. 52 0
      8_CSS3/8_CSS3flex.html
  2. 76 0
      8_CSS3/练习题3_旋转立方体.html

+ 52 - 0
8_CSS3/8_CSS3flex.html

@@ -0,0 +1,52 @@
+<!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: 800px;
+            height: 400px;
+            border:2px dashed black;
+            display: flex;
+            /* justify-content: center; */
+            /* align-items: center; */
+            /* flex-direction: column;
+            justify-content: space-around; */
+            flex-wrap: wrap;
+            align-content: space-between;
+        }
+        .box3{
+            /* order: -1; */
+            /* align-self: flex-end; */
+        }
+        .box div{
+            width: 100px;
+            height: 100px;
+            font-size: 40px;
+            font-weight: bolder;
+            text-align: center;
+            line-height: 100px;
+            background-color: red;
+        }
+        .box div:nth-child(odd){
+            background-color: blue;
+        }
+    </style>
+</head>
+<body>
+    <div class="box">
+        <div class="box1">1</div>
+        <div class="box2">2</div>
+        <div class="box3">3</div>
+        <div class="box4">4</div>
+        <div class="box5">5</div>
+        <div class="box6">6</div>
+        <div class="box7">7</div>
+        <div class="box8">8</div>
+        <div class="box9">9</div>
+        <div class="box10">10</div>
+    </div>
+</body>
+</html>

+ 76 - 0
8_CSS3/练习题3_旋转立方体.html

@@ -0,0 +1,76 @@
+<!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{
+            width: 100vw;
+            height: 100vh;
+            background-color: black;
+            perspective: 1000px;
+            perspective-origin: center 200px;
+        }
+        .box{
+            width: 400px;
+            height: 400px;
+            border:1px dashed #fff;
+            margin:100px auto;
+            position: relative;
+            transform-style: preserve-3d;
+            /* transform: rotateY(45deg); */
+            animation: foo 3s linear infinite;
+        }
+        @keyframes foo{
+            0%{
+                transform: rotateY(0);
+            }
+            100%{
+                transform: rotateY(360deg);
+            }
+        }
+        .box div{
+            position: absolute;
+            top: 0;
+            left: 0;
+            font-size: 40px;
+            font-weight: bolder;
+            color: blue;
+            text-align: center;
+            line-height: 400px;
+            width: 400px;
+            height: 400px;
+            background-color: rgba(255,255,255,.5);
+        }
+        .six{
+            transform: rotateX(-90deg) translateZ(200px);
+        }
+        .five{
+            transform: rotateX(-90deg) translateZ(-200px);
+        }
+        .four{
+            transform: rotateY(90deg) translateZ(200px);
+        }
+        .three{
+            transform: rotateY(90deg) translateZ(-200px);
+        }
+        .two{
+            transform: translateZ(200px);
+        }
+        .one{
+            transform: translateZ(-200px);
+        }
+    </style>
+</head>
+<body>
+    <div class="box">
+        <div class="one">1</div>
+        <div class="two">2</div>
+        <div class="three">3</div>
+        <div class="four">4</div>
+        <div class="five">5</div>
+        <div class="six">6</div>
+    </div>
+</body>
+</html>