问题:div的半透明边框应该透出body的蓝色图片背景而不是透出这个容器自己的橙色背景,如下图:

半透明边框

解决方法:运用background-clip:padding-box; background-clip默认的属性值是border-box,最终效果,如下图

半透明边框

<div style="width:200px;height:100px;background:orange;border: 10px solid rgba(255,255,255,.2);background-clip:padding-box;"></div>

相关文章:

  • 2021-12-04
  • 2021-08-29
  • 2021-12-15
  • 2021-12-16
  • 2021-12-26
  • 2021-10-01
  • 2021-10-01
  • 2021-09-06
猜你喜欢
  • 2021-10-01
  • 2021-12-25
  • 2021-10-20
  • 2021-12-26
  • 2021-06-10
  • 2021-12-26
  • 2021-10-01
  • 2021-10-01
相关资源
相似解决方案