0

我正在使用 html5 样板。在 IE 7 上,图像替换似乎不适用于使用内联块的 A href。我只是得到一个空白图像。但是,如果我在段落上使用 inline-block,则元素它可以工作。

在样板文件中使用图像替换的正确语法是什么?

<h1><a href="#" class="ir">Title</a></h1>  

或者

<h1 class="ir"><a href="#">Title</a></h1>  
4

1 回答 1

0

我会说第二个。ir类正在修改 h1 元素。文档说:

Add the .ir class to any element you are applying image-replacement to. When replacing an element's content with an image, make sure to also set a specific background-image: url(pathtoimage.png);, width, and height so that your replacement image appears.

所以应用到 h1 元素而不是锚元素是有意义的。

于 2013-06-13T18:44:32.687 回答