CSS sprites and IE6

2020-06-04 08:49发布

Does IE6 support css-sprites?

9条回答
叛逆
2楼-- · 2020-06-04 09:16

I have encountered the IE6 CSS sprites problem myself - I blogged it here:

There's a really easy fix - I quote myself here...

Luckily, the solution wasn't too bad. Internet Explorers passim seem to ignore overflow:hidden when a child element is set to position:relative. Not good news... but the solution is easy - set the element with overflow:hidden to also be position:relative and then change the position:relative declaration on the child to be position:absolute... the jobs a goodun.

The full details can be found on that link.

查看更多
甜甜的少女心
3楼-- · 2020-06-04 09:18

You can also use Glue http://gluecss.com/ It's an open-source command line tool to generate sprites.

查看更多
\"骚年 ilove
4楼-- · 2020-06-04 09:25

Yes.

CSS sprites is just a technique to use offset on background images to display different parts of the same image in different elements.

I use CSS sprites on for example the main menu on the website of the company I work for, and the flags on my own web site. I started using it before it was even called CSS sprites...

查看更多
闹够了就滚
5楼-- · 2020-06-04 09:25

Browsers which support background-position property will support CSS sprites also.

CSS Sprites: What They Are, Why They’re Cool, and How To Use Them

Please take a look at the following questions also

CSS Sprites images rendered with bad quality in IE

CSS Sprite Help

查看更多
Juvenile、少年°
6楼-- · 2020-06-04 09:27

Yes. If you're using PNGs though you should consider a few things. Here is a decent summary of IE 6 PNG issues:

http://24ways.org/2007/supersleight-transparent-png-in-ie6

查看更多
成全新的幸福
7楼-- · 2020-06-04 09:30

Yes IE 6 supports sprites but doesn't support 24 bit PNG transparency.

I use this css hack for giving IE < 7 a gif file and everything else a 24 bit png with transparency.

background-image:url(/images/sprites/icons-sprite.png);
_background-image:url(/images/sprites/icons-sprite.gif); /* IE<7 gets the crappy icons */
查看更多
登录 后发表回答