如何用CSS實現矩形按鈕右邊緣的中間有個往里凹的小半圓


<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title>test</title>
    <style>
      .btn {
        width: 100px;
        text-align: center;
        height: 50px;
        line-height: 50px;
        background: #000;
        color: #fff;
        position: relative;
      }
      .btn:after {
        position: absolute;
        content: '';   ------------主要是為了撐開容器div
        width: 30px;
        height: 30px;
        background: #fff;
        top: 10px;
        right: -15px;
        border-radius: 100%;
      }
    </style>
</head>
<body>
 <div class="btn">
   button
 </div>
</body>
</html>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM