纯css实现蒙德里安绘画

代码语言:html

所属分类:布局界面

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
@import url("https://fonts.googleapis.com/css?family=Raleway:300,400&display=swap");
body {
  overflow: hidden;
  font-family: "Raleway", sans-serif;
}

.container {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.frame {
  background: white;
  position: relative;
  width: 450px;
  height: 500px;
  border: 3px solid black;
  -moz-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

.painting {
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
  left: 12.5%;
  top: 10%;
  width: 75%;
  height: 70%;
  position: absolute;
  display: grid;
  grid-template-areas: "a a b b b b" "c c b b b b" "c c b b b b" "d d e e e f" "d d e e e g";
}

.item1 {
  grid-area: a;
  border-bottom: 5px solid black;
}

.item2 {
  grid-area: b;
  background: #dd0100;
  border-bottom: 5px solid black;
  border-left: 5px solid black;
}

.item3 {
  grid-area: c;
  border-bottom: 5px solid black;
}

.item4 {
  grid-area: d;
  background: #225095;
  border-bottom: 5px solid black;
}

.item5 {
  grid-area: e;
  border-left: 5px solid black;
  border-bottom: 5px solid black;
}

.item6 {
  grid-area: f;
  border-left: 5px solid black;
  border-bottom: 5px solid black;
}

.item7 {
  grid-area: g;
  border-left: 5px solid black;
  border-bottom: 5px solid black;
  b.........完整代码请登录后点击上方下载按钮下载查看

网友评论0