title: CSS: Style an empty box for the QR camera
body: <p>I'm designing for a website that has QR Code scan function, and interface required as below.</p>
  
  <p>When the camera is turned on, it will be full screen, the camera is covered by a transparent black layer, but in the middle is an unshielded square to scan the QR code.</p>
  
  <p><a href="https://i.stack.imgur.com/qNdgb.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qNdgb.jpg" alt="enter image description here"></a>
  I have designed like this
  HTML: </p>
  
  <pre><code>&lt;div class="videobox"&gt;
              &lt;div class="shape-qr"&gt;&lt;/div&gt;
              &lt;div class="videobox__inner"&gt;
                  &lt;video id="video" autoplay playsinline &gt;&lt;/video&gt;
              &lt;/div&gt;
           &lt;/div&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>.videobox, #video{
          text-align: center;
          position: relative;
          height: 100%;
          width: 100%;
      }
      .videobox .shape-qr{
          background: rgba(0,0,0,0.5);
          height: 100%;
          width: 100%;
          position: absolute;
          top: 0;
          left: 0;
          right:0;
          bottom: 0;
      }
  </code></pre>
  
  <p>The result was like this, but I did not know how to center the camera in a square space</p>
  
  <p><a href="https://i.stack.imgur.com/6HfE3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6HfE3.jpg" alt="enter image description here"></a></p>
  
  <p>Sympathy for English is not good, expect people to help!</p>
  
  <p>Thank you!</p>