PNG-8 format image opacity problem in IE8 & IE7

本文介绍了一个关于jQuery UI库在IE7和IE8浏览器中显示Tab面板时出现样式错误的问题。作者使用了png-24格式的图片替代png-8格式来解决IE浏览器对图片透明度解释不正确导致的黑色边框问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

/*by Jiangong SUN*/


I use jquery ui library for displaying several tabs with correspondant contents in my project. 


It works perfectly in Firefox and Chrome. When I click a tab different from current tab, it will show the content with new tab clicked.


Here is the correct display for my tabs:




Its css is like this:


.ui-tabs-panel { 
	display: block; 
	width: 890px; 
	float:left; 
	border-width: 0; 
	padding: 30px 15px 70px 40px; 
	margin-left:-15px; 
	background: url(bg-tab.png) 0 bottom no-repeat; 
}


But the tabs don't display correctly when I swtich tabs in IE7 & IE8.  

It displays just like this:




Just like what you've seen, the border becomes black, which cause my page disgracefully.


The reason is IE doesn't interprete the opacity of png-8 format image correctly. 


For this reason you can use the recommandation solutions of Jack Moore.


Or just change your image format from png-8 to png-24 like me, because IE works with png-24.


Hope this helps! 


Enjoy coding!


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值