3

过去一年半我一直在使用 cufon,但从未见过这个......

说我有:

<h2 class="my_font">This is some text</h2>    
<p class="my_font">This is some more text</p>

文本正确呈现,但换行符被呈现为新行,例如:

<h2 class="my_font"><cufon class="cufon cufon-canvas" alt=" " style="width: 5px; height: 16px; ">...</cufon</h2>

<cufon class="cufon cufon-canvas" alt=" " style="width: 5px; height: 16px; ">...</cufon>

<p class="my_font"><cufon class="cufon cufon-canvas" alt=" " style="width: 5px; height: 16px; ">...</cufon</p>

所以我最终在 h2 和 p 标签之间有 16px 的间隙。我唯一能做的就是将所有内容放在同一行或注释掉换行符:

<h2 class="my_font">This is some text</h2><!--    
--><p class="my_font">This is some more text</p>

另外,我认为重要的是要提到这发生在使用 cufon 的任何地方,它并不孤立于上面的 html 示例。知道是什么原因造成的吗?

谢谢!

4

1 回答 1

1

你的Cufon.replace('');代码是什么样的?

这可能是由于对大型父元素执行延迟替换导致的,如下所示:

Cufon.replace('ul, div#foo');

相反,您应该更具体并针对容器内的特定元素,例如:

Cufon.replace('div#foo h2, div#foo span');

也许这不是你的问题,但我已经看到它以这种方式发生过。让我知道。

于 2010-08-27T03:09:55.067 回答