css实现一个带灯闪烁的圣诞树效果代码

代码语言:html

所属分类:布局界面

代码描述:css实现一个带灯闪烁的圣诞树效果代码

代码标签: 带灯 闪烁 圣诞树 效果

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

<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
  
  
  
<style>
:root {
  --background-color: #101B2A;
  --tree-color: #1B885E;
  --yellow: #FFFC5E;
}

body{
  background: var(--background-color);
}

.box-canvas{
  position: relative;
  margin: auto;
  display: block;
  margin-top: 10vmin;
  margin-bottom: 10vmin;
  width: 80vmin;
  height: 80vmin;
}

/* Bottom tree piece */
.tree {
  position: absolute;
  left: 50%;
  -webkit-transform: translateX(-50%);
          transform: translateX(-50%);
  bottom: 20vmin;
  width: 0;
  height: 0;
  border-bottom: 32vmin solid var(--tree-color);
  border-right: 32vmin solid transparent;
  border-left: 32vmin solid transparent;
}

/* Tree middle */
.tree::before {
  content: '';
  position: absolute;
  left: 50%;
  -webkit-transform: translateX(-50%);
          transform: translateX(-50%);
  bottom: -16vmin;
  width: 0;
  height: 0;
  border-bottom: 27vmin solid var(--tree-color);
  border-right: 27vmin solid transparent;
  border-left: 27vmin solid transparent;
}

/* Tree top */
.tree::after {
  content: '';
  position: absolute;
  left: 50%;
  -webkit-transform: translateX(-50%);
          transform: translateX(-50%);
  bottom: 0vmin;
  width: 0;
  height: 0;
  border-bottom: 19vmin solid var(--tree-c.........完整代码请登录后点击上方下载按钮下载查看

网友评论0