內(nèi)半圓樣式

微信截圖_20210520201338.png
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body {
        background: #333;
      }
      #modal {
        width: 300px;
        height: 400px;
        margin: 30px auto;
      }
      p {
        margin: 0;
        padding: 0;
      }
      .top-box {
        width: 100%;
        height: 200px;
        background: red;
        position: relative;
        margin-bottom: 20px;
        border-radius: 4px 4px 0 0;
      }
      .bottom-box {
        width: 100%;
        height: 100px;
        background: #fff;
        position: relative;
        border-radius: 0 0 4px 4px;
      }
      .top-box p,
      .bottom-box p {
        width: calc(100% - 20px);
        height: 10px;
        position: absolute;
        left: 10px;
      }
      .top-box p {
        background: red;
        bottom: -10px;
      }
      .bottom-box p {
        background: #fff;
        top: -10px;
      }
      .top-box p::before,
      .bottom-box p::before {
        content: '';
        position: absolute;
        width: 10px;
        height: 10px;
        left: -10px;
      }
      .top-box p::after,
      .bottom-box p::after {
        content: '';
        position: absolute;
        width: 10px;
        height: 10px;
        right: -10px;
      }
      .top-box p::before {
        background-image: radial-gradient(circle 10px at 0 100%, transparent 50px, red 50%);
      }
      .top-box p::after {
        background-image: radial-gradient(circle 10px at 100% 100%, transparent 50px, red 50%);
      }
      .bottom-box p::before {
        background-image: radial-gradient(circle 10px at 0 0, transparent 50px, #fff 50%);
      }
      .bottom-box p::after {
        background-image: radial-gradient(circle 10px at 100% 0, transparent 50px, #fff 50%);
      }
    </style>
  </head>
  <body>
    <div id="modal">
      <div class="mask"></div>
      <div class="wrap">
        <div class="top-box">
          <p></p >
        </div>
        <div class="bottom-box">
          <p></p >
        </div>
      </div>
    </div>
  </body>
</html>
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容