单个div+css实现一个棉花糖效果代码

代码语言:html

所属分类:布局界面

代码描述:单个div+css实现一个棉花糖效果代码

代码标签: 单个 div css 棉花糖

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">



    <style>
        body {
          min-height: 400px;
          height: 100vh;
          position: relative;
          background-color: #ffc0cb;
        }
        div {
          position: absolute;
          left: 50%;
          top: 50%;
        }
        div::before,
        div::after {
          display: block;
          content: '';
          position: absolute;
        }
        #soft {
          width: 280px;
          height: 24px;
          margin-left: -140px;
          margin-top: -12px;
          background-image: repeating-linear-gradient(50deg, #fff, #fff 0.6em, #dc143c 0.6em, #dc143c 1.2em);
          border-top-left-radius: 20em 1em;
          border-bottom-left-radius: 20em 1em;
          box-shadow: inset 0 0.2em 0.3em rgba(178,34,34,0.4), inset 0 -0.2em 0.3em rgba(178,34,34,0.4);
          transform: rotate(-90deg);
        }
        #soft::before {
          width: 210px;
          height: 160px;
          right: -5%;
          bottom: 50%;
          margin-bottom: -80px;
          background-image: linear-gradient(to right, #dda0dd, #afeeee, #fffac.........完整代码请登录后点击上方下载按钮下载查看

网友评论0