Vadim Asked:2022-08-02 19:48:55 +0800 CST2022-08-02 19:48:55 +0800 CST 2022-08-02 19:48:55 +0800 CST 如何布置这些块,如何从另一个元素中切割一个元素 772 我需要布置 3 个块,只有在布置一个圆圈时,我才需要看到背景不是绿色,而是最外面的块的背景(红色)。 вёрстка 1 个回答 Voted Best Answer Проста Miha 2022-08-02T20:10:04+08:002022-08-02T20:10:04+08:00 你可以使用'box-shadow' .block { background-color: red; display: inline-block; padding: 32px; } .hasCircle { width: 480px; height: 300px; position: relative; overflow: hidden; } .hasCircle:after { content: " "; position: absolute; left: 0; right: 0; margin: 100px auto; width: 100px; height: 100px; border-radius: 50%; box-shadow: 0 0 0 1000px #000; } <div class="block"> <div class="hasCircle"></div> </div>
你可以使用'box-shadow'