CSS3第五课 平角在渐变的基础上

简介: CSS3第五课 平角在渐变的基础上


<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <style type="text/css">
    *{
      background-image: linear-gradient(-135deg,
      #661a08,#664608,#426608,#44c312,#12c36a,
      #35e5ce,#3ea1ee,#3e6fee,#6b3eee,#c06eea,
      #e36eea,#ea6ebd,#ed2b54);
      text-decoration: dashed;
      text-align: center;
      font-size: 2.5rem;
    }
      body {
        display: flex;
        justify-content: space-around;
        flex-wrap: wrap;
        /* background-color:; */
        background-color: #000000;
      }
      div {
        width: 300px;
        height: 200px;
        background-color: black;
        border: red solid 2px;
        margin: 10px;
        text-decoration: dashed;
        text-align: center;
        font-size: 2.5rem;
      }
      div:nth-child(1) {
        background-image: linear-gradient(45deg, red 10%, pink 10%);
        /* 切角的效果 */
        background-image: linear-gradient(45deg, transparent 8%, pink 10%);
      }
      div:nth-child(2) {
        background-image: linear-gradient(45deg, red 10%, pink 10%);
        /* 切角的效果 */
        background-image: linear-gradient(-45deg, transparent 8%, pink 10%);
      }
      div:nth-child(3) {
        /* 切角的效果 */
        background-image: linear-gradient(45deg, #00FF99 8%, pink 0%), linear-gradient(-45deg, red 8%, pink 0%);
        background-size: 100% 100%;
        background-repeat: no-repeat;
      }
      div:nth-child(4) {
        /* 切角的效果 */
        background-image: linear-gradient(45deg, #00FF99 10%, pink 0%);
        background-image: linear-gradient(45deg, transparent 8%, pink 0%);
      }
      div:nth-child(5) {
        /* 切角的效果 */
        background: linear-gradient(45deg, red 10%, pink 0) left,
          linear-gradient(-45deg, red 8%, green 0) right;
        background-size: 50% 100%;
        background-repeat: no-repeat;
      }
      div:nth-child(6) {
        /* 切角的效果 */
        background: linear-gradient(45deg, red 10%, pink 0) right,
          linear-gradient(-45deg, red 8%, green 0) left;
        background-size: 50% 100%;
        background-repeat: no-repeat;
      }
      /* 切角 */
      div:nth-child(7) {
        /* 切角的效果 */
        background: linear-gradient(45deg, transparent 10%, pink 0) right,
          linear-gradient(-45deg, transparent 8%, green 0) left;
        background-size: 50% 100%;
        background-repeat: no-repeat;
      }
      div:nth-child(8) {
        /* 切角的效果 */
        background: linear-gradient(45deg, transparent 10%, pink 0) left,
          linear-gradient(-45deg, transparent 8%, green 0) right;
        background-size: 50% 100%;
        background-repeat: no-repeat;
      }
      div:nth-child(9) {
        /* 切角的效果 */
        background: linear-gradient(45deg, transparent 10%, yellow 0) left bottom,
          linear-gradient(-45deg, transparent 10%, red 0) right bottom,
          linear-gradient(-135deg, transparent 10%, pink) right top,
          linear-gradient(135deg, transparent 10%, green 0) left top;
        background-repeat: no-repeat;
      }
      div:nth-child(10) {
        /* 切角的效果 */
        background:
          linear-gradient(45deg, transparent 10%, yellow 0) left bottom,
          linear-gradient(-45deg, transparent 10%, red 0) right bottom,
          linear-gradient(-135deg, transparent 10%, pink) right top,
          linear-gradient(135deg, transparent 10%, green 0) left top;
        background-size: 50% 50%;
        background-repeat: no-repeat;
      }
      div:nth-child(11) {
        /* 切角的效果 */
        background:
          linear-gradient(45deg, transparent 10%, green 0) left bottom,
          linear-gradient(-45deg, transparent 10%, pink 0) right bottom,
          linear-gradient(-135deg, transparent 10%, blue 0) right top,
          linear-gradient(135deg, transparent 10%, purple 0) left top;
        background-size: 50% 50%;
        background-repeat: no-repeat;
      }
      div:nth-child(12) {
        background-image: linear-gradient(red,blue,yellow);
        background-image: linear-gradient(45deg, red 10%, pink 10%);
        /* 切角的效果 */
        background-image: linear-gradient(25deg,yellow,red,green,blue,black);
        background-image: linear-gradient(45deg, transparent 8%, pink 10%);
      }
      div:nth-child(13) {
        background-image: linear-gradient(45deg, red 10%, pink 10%);
        /* 切角的效果 */
        background-image: linear-gradient(-45deg, transparent 8%, pink 10%);
      }
      div:nth-child(14) {
        /* 切角的效果 */
        background-image: linear-gradient(45deg, #00FF99 8%, pink 0%), linear-gradient(-45deg, red 8%, pink 0%);
        background-size: 100% 100%;
        background-repeat: no-repeat;
      }
      div:nth-child(15) {
        /* 切角的效果 */
        background-image: linear-gradient(45deg, #00FF99 10%, pink 0%);
        background-image: linear-gradient(45deg, transparent 8%, pink 0%);
      }
      div:nth-child(16) {
        /* 切角的效果 */
        background: linear-gradient(45deg, red 10%, pink 0) left,
          linear-gradient(-45deg, red 8%, green 0) right;
        background-size: 50% 100%;
        background-repeat: no-repeat;
      }
      div:nth-child(17) {
        /* 切角的效果 */
        background: linear-gradient(45deg, red 10%, pink 0) right,
          linear-gradient(-45deg, red 8%, green 0) left;
        background-size: 50% 100%;
        background-repeat: no-repeat;
      }
      /* 切角 */
      div:nth-child(18) {
        /* 切角的效果 */
        background: linear-gradient(45deg, transparent 10%, pink 0) right,
          linear-gradient(-45deg, transparent 8%, green 0) left;
        background-size: 50% 100%;
        background-repeat: no-repeat;
      }
      div:nth-child(19) {
        /* 切角的效果 */
        background: linear-gradient(45deg, transparent 10%, pink 0) left,
          linear-gradient(-45deg, transparent 8%, green 0) right;
        background-size: 50% 100%;
        background-repeat: no-repeat;
      }
      div:nth-child(20) {
        /* 切角的效果 */
        background: linear-gradient(45deg, transparent 10%, yellow 0) left bottom,
          linear-gradient(-45deg, transparent 10%, red 0) right bottom,
          linear-gradient(-135deg, transparent 10%, pink) right top,
          linear-gradient(135deg, transparent 10%, green 0) left top;
        background-repeat: no-repeat;
      }
      div:nth-child(21) {
        /* 切角的效果 */
        background:
          linear-gradient(45deg, transparent 10%, yellow 0) left bottom,
          linear-gradient(-45deg, transparent 10%, red 0) right bottom,
          linear-gradient(-135deg, transparent 10%, pink) right top,
          linear-gradient(135deg, transparent 10%, green 0) left top;
        background-size: 50% 50%;
        background-repeat: no-repeat;
      }
      div:nth-child(22) {
        /* 切角的效果 */
        background:
          linear-gradient(45deg, transparent 10%, green 0) left bottom,
          linear-gradient(-45deg, transparent 10%, pink 0) right bottom,
          linear-gradient(-135deg, transparent 10%, blue 0) right top,
          linear-gradient(135deg, transparent 10%, purple 0) left top;
        background-size: 50% 50%;
        background-repeat: no-repeat;
      }
      div:nth-child(24) {
        /* 切角的效果 */
        background:
          linear-gradient(45deg, transparent 10%, green 0) left bottom,
          linear-gradient(-45deg, transparent 10%, pink 0) right bottom,
          linear-gradient(-135deg, transparent 10%, blue 0) right top,
          linear-gradient(135deg, transparent 10%, purple 0) left top;
        background-size: 50% 50%;
        background-repeat: no-repeat;
      }
    </style>
    <title></title>
  </head>
  <body>
    <!-- div*24+tab -->
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </body>
</html>
相关文章
|
6月前
|
前端开发
技术经验分享:CSS画三角形(三种方法)
技术经验分享:CSS画三角形(三种方法)
29 0
|
7月前
|
前端开发
【CSS进阶】使用CSS gradient制作绚丽渐变纹理背景效果(中)
【CSS进阶】使用CSS gradient制作绚丽渐变纹理背景效果
180 1
|
7月前
|
前端开发
【CSS进阶】使用CSS gradient制作绚丽渐变纹理背景效果(下)
【CSS进阶】使用CSS gradient制作绚丽渐变纹理背景效果
188 1
|
7月前
|
前端开发 容器
【CSS进阶】使用CSS gradient制作绚丽渐变纹理背景效果(上)
【CSS进阶】使用CSS gradient制作绚丽渐变纹理背景效果
169 1
|
7月前
|
前端开发 UED
【专栏:CSS基础篇】CSS背景与边框:设计网页外观
【4月更文挑战第30天】CSS中的背景和边框是网页设计的关键元素,能增强视觉层次和用户体验。背景可通过`background-color`设置颜色,`background-image`添加图像,`background-position`和`background-size`调整位置和大小。边框用`border-style`定义样式,`border-width`设定宽度,`border-radius`创建圆角。理解并巧妙运用这些属性,结合媒体查询实现响应式设计,将使网页更具吸引力和功能性。不断学习和创新是提升设计能力的关键。
103 0
|
7月前
|
前端开发
【CSS进阶】巧用伪元素before和after制作绚丽效果(下)
【CSS进阶】巧用伪元素before和after制作绚丽效果(下)
78 0
|
移动开发 前端开发
移动开发之css3实现背景几种渐变效果
移动开发之css3实现背景几种渐变效果
82 0
|
前端开发
CSS实战笔记(三) 滤镜效果
CSS实战笔记(三) 滤镜效果
124 0
|
前端开发
CSS实战笔记(二) 几何图形
CSS实战笔记(二) 几何图形
98 0
|
前端开发
重学前端 41 # CSS的颜色
重学前端 41 # CSS的颜色
110 0
重学前端 41 # CSS的颜色