我在过去的一年半里一直在使用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示例。知道是什么原因造成的吗?
谢谢!
发布于 2010-08-27 11:09:55
您的Cufon.replace('');代码是什么样子的?
这可能是由于对大型父元素进行懒惰替换而导致的,比如:
Cufon.replace('ul, div#foo');相反,您应该更具体,并针对容器中的特定元素,例如:
Cufon.replace('div#foo h2, div#foo span');也许这不是你的问题,但我以前见过这种情况。让我知道。
https://stackoverflow.com/questions/3514790
复制相似问题