|
|
@@ -0,0 +1,69 @@
|
|
|
+<!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: 200px;
|
|
|
+ height: 200px;
|
|
|
+ border:3px dashed blue
|
|
|
+ }
|
|
|
+ .box2{
|
|
|
+ width: 200px;
|
|
|
+ height: 200px;
|
|
|
+ background-color: red;
|
|
|
+ }
|
|
|
+ /* 块元素在不设置高宽的情况下 */
|
|
|
+ /* 宽度默认是父元素的宽度 */
|
|
|
+ /* 高度默认是内容的高度 */
|
|
|
+ /* .box3{
|
|
|
+ background-color: red; */
|
|
|
+ /* padding: 100px 0; */
|
|
|
+ /* padding-top: 200px;
|
|
|
+ } */
|
|
|
+ .box3{
|
|
|
+ border:100px solid black;
|
|
|
+ }
|
|
|
+
|
|
|
+ .box4{
|
|
|
+ width: 200px;
|
|
|
+ height: 200px;
|
|
|
+ background-color: green;
|
|
|
+ /* border-radius: 100px; */
|
|
|
+ /* 圆角是可以使用百分比 百分比相较于父元素的宽度 */
|
|
|
+ /* 百分比一般使用在未知元素尺寸的情况下 */
|
|
|
+ border-radius: 50%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .box5{
|
|
|
+ border-top:100px solid transparent;
|
|
|
+ border-left: 100px solid green;
|
|
|
+ border-bottom: 100px solid transparent;
|
|
|
+ border-right: 100px solid transparent;
|
|
|
+ }
|
|
|
+ .box6{
|
|
|
+ width: 0;
|
|
|
+ border-top:100px solid transparent;
|
|
|
+ border-left: 100px solid transparent;
|
|
|
+ border-bottom: 100px solid blue;
|
|
|
+ border-right: 100px solid transparent;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+ <div class="box1">
|
|
|
+ <div class="box2"></div>
|
|
|
+ </div>
|
|
|
+ <div class="box1">
|
|
|
+ <div class="box3"></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="box4"></div>
|
|
|
+
|
|
|
+ <div class="box5"></div>
|
|
|
+
|
|
|
+ <div class="box6"></div>
|
|
|
+</body>
|
|
|
+</html>
|