半透明边框
知识点:
1 | background-clip(规定背景的绘制区域): |
实现:
1 | border: 12px solid rgba(0,0,0,0.5); |
多重边框
知识点: box-shadow实现多重阴影。
outline实现两层边框
实现:
方案一
1 | background: yellowgreen; |
方案二
1 | outline: 5px solid deeppink; |
灵活的背景定位
知识点: background-position指定偏移量
1 | background-origin相对于什么位置来定位: |
实现:
方案一
1 | background:url('xx') no-repeat bottom right #58a; |
方案二
1 | padding: 10px 20px; |
方案三
1 | background:url('xx') no-repeat #58a; |
边框内圆角
知识点: box-shadow、outline多重边框
实现:
1 | outline: 6px solid #655; |
背景条纹
知识点:css渐变、background-size
水平条纹
实现:
1 | //两条条纹 |
垂直条纹
实现:
1 | background: linear-gradient(to right, #fb3 50%, #58a 0);//一样宽的条纹 |
斜向条纹
实现:
普通:
1 | background: linear-gradient(45deg, #fb3 25%, #58a 0, #58a 50%, #fb3 0, #fb3 75%, #58a 0); |
增强版:
1 | //创建重复的线性渐变 |
毛玻璃效果
实现:
1 | body, .box::before { |
折角效果
实现:
1 | .box{ |
minxin
1 | @mixin folded-corner($background, $size, $angle: 30deg) { |
蒙版
知识点:通过box-shadow添加蒙版
实现:
1 | .modal{ |