css 实现 Popover 弹出框样式

2023-12-24 19:15:40
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
        body {
            margin: 20px;
        }
      .box {
        box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
        width: 200px;
        height: 100px;
        position: relative;
        border: 1px solid #ebeef5;
      }
      .arrow {
        border-width: 6px;
        position: absolute;
        width: 0;
        height: 0;
        border-color: transparent;
        border-style: solid;
        margin-left: -6px;
        top: -6px;
        left: 50%;
        border-top-width: 0;
        border-bottom-color: #ebeef5;
      }
      .arrow::after {
        content: " ";
        border-width: 6px;
        position: absolute;
        display: block;
        width: 0;
        height: 0;
        border-color: transparent;
        border-style: solid;
        top: 1px;
        margin-left: -6px;
        border-top-width: 0;
        border-bottom-color: #fff;
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="arrow"></div>
    </div>
  </body>
</html>

文章来源:https://blog.csdn.net/wu_xianqiang/article/details/135184244
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。