English 中文(简体)
为什么背景:url( )没有在IE6工作?
原标题:why background:url( ) not working in IE6?

I ve used url() in my project, but it is not showing the picture in IE 6? does IE6 not support url()? How should I solve the problem?
The code is as below:

<img class="avatar" style="background:url( ./avatar.jpg ) no-repeat scroll 5px 7px transparent;" />
最佳回答

使用<条码>背井离层:

<img class="avatar" style="background-image:url( ./avatar.jpg )" />

请注意,您在结尾处有附加<代码>。

并确保这实际上与背景形象有关。 如果你确定背景,情况如何? 你们是否看到了吗? 这可能是一个排他性的问题,不会出现。

问题回答

整个主角看错。 我愿这样做:

<img class="avatar" style="background-image: url( ./avatar.jpg );" alt="" />

我还将核实这条道路是正确的。

--————

经过测试,我注意到,像<代码>一样的道路永远不会奏效。 它寻找一个题为<代码>的夹,,与你书写风格的档案相同的目录。 您是否有一个名为的夹子? 我不这样做。 它是一个非法的名录。





相关问题
Image rendered with wrong colors in IE8

I have a gradient image as a PNG (no transparency) in a web-page. By taking a screenshot of Chrome showing the page and cropping the image from the page, I see the exact same colors are drawn as the ...

Determine Mobile Internet Explorer version

I need to determine the version of Mobile Internet Explorer on a Windows Mobile 6.1 device. So that I can report the same user-agent string as is being used by Mobile Internet Explorer. The user-...

CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

Internet Explorer only part loading JavaScript/CSS

I m having trouble with my local development environment where IE (6 through to 8) is only part loading JavaScript/CSS files. It throws random errors at random places in jquery.min.js every time I ...

IE doesn t run Javascript when you click back button

I ve built a shop with tons of JS running. One of the pieces of the cart, is a zip code field which is required to calculate shipping cost. This works fine going through the cart. Now clicking ...