css graphics drawing, to achieve a concave rounded box with a circle in the middle

Tip: The following is the text of this article, and the following cases are for reference

1. Case requirements

Example:

Two, implement the code

1. The code is as follows (example):

<div style="display:flex">
      <div class="block"
      style="width: 350px;height: 125px;background-image: radial-gradient(200px at 100% 128px, transparent 200px, #f5f5f5 50%);"
      ></div>
      <div class="block"
      style="width: 350px;height: 125px;background-image: radial-gradient(199px at 0% 128px, transparent 200px, #f5f5f5 50%);"
      ></div>
      </div>
      <div style="display:flex; margin-top:20px">
      <div class="block"
      style="width: 350px; height: 125px; background-image: radial-gradient(200px at 100% 0px, transparent 200px, #f5f5f5 50%);"
      ></div>
      <div class="block"
      style="width: 350px;height: 125px;background-image: radial-gradient(200px at 0% 0px, transparent 200px, #f5f5f5 50%);"
      ></div>
      </div>


Summarize

Realize concave rounded corners, the middle of the four boxes is sunken into a circle

Guess you like

Origin blog.csdn.net/m0_49017085/article/details/126039248