两个定位相同的相同div互相辉映

问题描述 投票:0回答:1

我的容器内有两个 div:

<div>
    <div className="first"/>
    <div className="second"/>
</div>
      
  .first {
    position: absolute;
    background-color: white;
    border-radius: 0.5rem;
    z-index: 1;
  }

  .second {
    position: absolute;
    background-color: black;
    border-radius: 0.5rem;
    z-index: 2;
  }

Screenshot of a problem (look at the edges of black circle)

我尝试过使用 z 索引、轮廓、边框,但没有任何帮助,并且当应用轮廓和边框时问题仍然出现(轮廓和边框之间的白色线聚光灯)

html css antialiasing
1个回答
0
投票

可能是抗锯齿在起作用。您可以尝试使用更大的相同颜色的边框/轮廓来覆盖底部。

© www.soinside.com 2019 - 2024. All rights reserved.