Home > Web Front-end > HTML Tutorial > IE6不支持透明的PNG图片,有灰白底色_html/css_WEB-ITnose

IE6不支持透明的PNG图片,有灰白底色_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:29:13
Original
1192 people have browsed it

解决方案:

1. 滤镜

IE浏览器中特有的滤镜效果,且必须将png文件作为背景图像.

Filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src=string,sizingMethod)是否启用滤镜效果.背景图像的显示方式

Image:放大或缩小盒子尺寸,以显示整个背景图像.

Crop:裁切图片以适应对象尺寸.

Scale:缩放图片以适应对象尺寸.

#box{ // 针对IE

  Width:152px;

  Height:152px;

 Filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=”PNG图像的URL” ,sizingMethod=image)

}

Html>body #box{ // 针对非IE

        Background:url(images/circle.png);

}

1. JS+透明gif

引用外部的JS文件,(只针对文档中的图片png ,对背景无效)

<script></script>

2. DD_belatedPNG

前两个不支持background-position,background-repeat

例如:fix(‘#box,img’) , fix(‘#box,background’).

在使用方案一为背景图像添加链接时,在IE6中,背景图像的非空白区域不能触发链接,解决方案:为链接添加position:relative;属性.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template