FineDay

浏览器下的CSS透明度

元素透明度时常是个恼人的问题,下面这种方式可以实现所有浏览器下的透明度设置:

		.transparent {
      zoom: 1;
      filter: alpha(opacity=50);
      opacity: 0.5;
		}
	

但是使用opacity会影响其后代元素的透明度,我们可以考虑使用:

		.transparent {
			/* Fallback for web browsers that doesn\'t support RGBa */
			background: rgb(0, 0, 0);
			/* RGBa with 0.6 opacity */
			background: rgba(0, 0, 0, 0.6);
			/* For IE 5.5 - 7*/
			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
			/* For IE 8*/
			-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
		}
	

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-10-06
  • 2022-03-09
  • 2021-11-28
  • 2021-07-18
  • 2022-12-23
  • 2021-08-22
猜你喜欢
  • 2021-12-15
  • 2021-12-15
  • 2021-10-21
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2022-02-22
相关资源
相似解决方案