CSS 实现边框四角

CSS   2024-07-20 11:23   63   0  
<!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>
    html, body {
      padding: 0;
      margin: 0;
    }
    body {
      height: 100vh;
      width: 100vw;
      background: #08304A;
      overflow: auto;
      border: 1px solid transparent;
    }
    .intro {
      position: relative;
      color: #fff;
      width: 200px;
      height: 400px;
      margin-top: 200px;
      margin-left: 200px;
    }
    .intro > span {
        position: absolute;
        width: 10px;
      height: 10px;
    }
    .lpArrow { 
      border-top: 1px solid #00F6E5;
      border-left: 1px solid #00F6E5;
    }
    .rpArrow {
      right: 0;
      border-top: 1px solid #00F6E5;
      border-right: 1px solid #00F6E5;
    }
    .lbArrow {
      bottom: 0;
      border-left: 1px solid #00F6E5;
      border-bottom: 1px solid #00F6E5;
    }
    .rbArrow {
      right: 0;
      bottom:0;
      border-right: 1px solid #00F6E5;
      border-bottom: 1px solid #00F6E5;
    }
  </style>
</head>
<body>
  <div class="intro" style="background: rgba(255,255,255,0.1)">
    <span class="lpArrow"></span>
    <span class="rpArrow"></span>
    <span class="lbArrow"></span>
    <span class="rbArrow"></span>
  </div>
</body>
</html>