美文网首页
CSS实现消息框中带阴影效果的三角形箭头

CSS实现消息框中带阴影效果的三角形箭头

作者: 小悟空大仙人 | 来源:发表于2020-05-17 16:52 被阅读0次
    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width">
      <title>CSS实现消息框中带阴影效果的三角形箭头</title>
      <style>
        .box {
          position: relative;
          width: 600px;
          height: 400px;
          background: #fff;
          border: 1px solid #ccc;
          box-shadow: 2px 2px 2px #ccc;
        }
        .box:after {
          position: absolute;
          display: inline-block;
          top: 380px;
          left: 300px;
          width: 0;
          height: 0px;
          content: '';
          border-style: solid;
          border-width: 20px;
          border-color: #fff #fff transparent transparent;
          transform: rotate(135deg);
          box-shadow: 2px -2px 2px #ccc;
        }
      </style>
    </head>
    <body>
      <div class="box">
      </div>
    </body>
    </html>
    

    相关文章

      网友评论

          本文标题:CSS实现消息框中带阴影效果的三角形箭头

          本文链接:https://www.haomeiwen.com/subject/nzysohtx.html