css伪元素实现倾斜旋转效果代码

代码语言:html

所属分类:布局界面

代码描述:css伪元素实现倾斜旋转效果代码

代码标签: css 伪元素 倾斜 旋转

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">




    <style>
        .wrap {
          width: 90vw;
          display: grid;
          grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
          place-items: center;
          gap: 3em;
        }
        p {
          color: white;
          text-decoration: none;
          /* mix-blend-mode: blend; */
        }
        .title {
            position: relative;
            width: 220px;
          margin: 3em auto;
            font-size: 18px;
            text-align: center;
            position: relative;
            color: #FFF;
            border-radius: 8px;
            box-shadow: 5px 5px 30px -10px rgba(0 0 0 / 1);
        }
        .one::after, .two::after, .two::before, .three::after, .three::before, .four::after, .four::before, .five::before, .five::after, .six::before, .six::after {
            content: " ";
            position: absolute;
            display: block;
            width: 100%;
            height: 100%;
            background: #FF00ff;
            z-index: -10;
        }
        .one {
            background: indigo;
        }
        .one::after {
            top: -35%;
            left: -3%;
            background: gold;
            border-radius: 0 100% 0 10%;
            transform-origin: center bottom;
            transform: skewX(-50deg) rotate(-20deg);
        }
        
        .two {
          top: 0;
          left: -10%;
          background: forestgreen;
        }
        .two::after {
            top: -20%;
            left: 20%;
          border-radius: 10px 10px 5px 0;
          background: magenta;
            transform-origin: top right;
            transform: skewX(30deg);
        }
        .two::before {
            top: 70%;
            left: 20%;
          border-radius: 0 5px 10px 10px;
          background: magenta;
            transform-origin: bottom right;
            transform: skewX(-30deg);
        }
        .two {
          box-shadow: 3px 3px 20px -5px black;
        }
        
        .three {
          background: dodgerblue;
        }
        .three::after {
          top: 25%;
          left: 10%;
            transform-origin: bottom right;
          background: green;
          transform: rotate(-4deg);
        }
        .three::before {
          top: 20%;
          left: 5%;
          background: blue;
          bord.........完整代码请登录后点击上方下载按钮下载查看

网友评论0