css3

css的base配置

# 1. 获取 div 的所有样式属性

let curElementTop = document.getElementById('header')

let styles = window.getComputedStyle(curElementTop).getPropertyValue('top') // 获取当前的top属性

# 2. 1px 实现

.hairlines li {
  height: 50px;
  line-height: 50px;
  border: none;
  text-align: center;
  position: relative;
  margin-top: 10px;
}

.hairlines li:after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  border: 1px solid #cccccc;
  width: 200%;
  height: 200%;
  -webkit-transform: scale(0.5);
  transform: scale(0.5);
  -webkit-transform-origin: left top;
  transform-origin: left top;
}

# 3. 工具插件

  • 多边形生成器 https://bennettfeely.com/clippy/
  • 不规则背景 https://getwaves.io/
  • 阴影 https://shadows.brumm.af
上次更新: