css实现4种不同的丝带效果代码

代码语言:html

所属分类:布局界面

代码描述:css实现4种不同的丝带效果代码

代码标签: css 丝带

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">






    <style>
        body {
          background: #b8deeb;
        }
        
        h1 {
          margin-top: 70px;
          color: #fff;
          font-family: Helvetica, sans-serif;
          font-weight: normal;
          text-align: center;
          letter-spacing: 1px;
          text-shadow: -2px 2px #90cce0;
        }
        
        .box {
          width: 400px;
          height: 600px;
          margin: 50px auto;
          background: #fff;
          border-radius: 3px;
        }
        
        [class^=ribbon-] {
          position: relative;
          margin-bottom: 80px;
        }
        [class^=ribbon-]:before, [class^=ribbon-]:after {
          content: "";
          position: absolute;
        }
        
        .ribbon-1 {
          width: 60px;
          height: 100px;
          background: #ee583a;
          top: -6px;
          left: 25px;
        }
        .ribbon-1:before {
          height: 0;
          width: 0;
          border-bottom: 6px solid #ca3011;
          border-right: 6px solid transparent;
          right: -6px;
        }
        .ribbon-1:after {
          height: 0;
          width: 0;
          border-left: 30px solid #ee583a;
          border-right: 30px solid #ee583a;
          border-bottom: 30px solid transparent;
          bottom: -30px;
        }
        
        .ribbon-2 {
          width: 150px;
          height: 50px;
          background: #21749a;
          left: -8px;
        }
        .ribbon-2:before {
          height: 0;
          width: 0;
          border-bottom: 8px solid #14455b;
          border-left: 8px solid transparent;
          top: -8px;
        }
        .ribbon-2:after {
          height: 0;
          width: 0;
          border-top: 25px solid transparent;
          border-bottom: 25px solid transparent;
          border-left: 15px solid #21749a;
          right: -15px;
        }
        
        .ribbon-3, .ribbon-4 {
          width: 420px;
     .........完整代码请登录后点击上方下载按钮下载查看

网友评论0