首页 > 解决方案 > 在类中使用的某些背景颜色(如 #4f8a2ad4 或 #8a2a5fd4)在 div 和 img 元素中使用时具有不同的阴影

问题描述

有关提到的问题,请参见图片

问:为什么颜色有不同的阴影/不透明度,我该如何解决?

<!DOCTYPE.html>

<head>
  <meta charset="utf-8">
  <style type="text/css">
    .maroon {
      background-color: #4f8a2ad4;
    }
  </style>
</head>

<body>
  <div class="maroon">
    <img class="maroon" height="200" src="http://www.pngmart.com/files/7/CDN-PNG-Transparent-Image.png" alt="Any image with transparent 
      background">
  </div>
</body>

标签: htmlcsscolors

解决方案


推荐阅读