Cufon渲染换行符

发布于 2024-09-15 02:52:33 字数 921 浏览 0 评论 0原文

我在过去一年半中一直在使用 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>

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

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

另外,我认为重要的是要提到这种情况发生在使用 cufon 的任何地方,它与 html 示例无关多于。知道是什么原因造成的吗?

谢谢!

I have been using cufon for the last year and a half and have never seen this...

Say I have:

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

The text is rendered properly but the line break gets rendered as a new line, for example:

<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>

So I end up with a 16px gap between the h2 and p tags. The only thing I have been able to do to prevent it is, put everything on the same line or comment out the line break:

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

Also, I think it's important to mention that this happens anywhere cufon is used, it's not isolated to the html example above. Any idea what could be causing this?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

多情癖 2024-09-22 02:52:33

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

这可能是由于对大型父元素进行惰性替换造成的,如下所示:

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

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

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

也许这不是您的问题,但我以前见过这种情况发生过。让我知道。

What does your Cufon.replace(''); code look like?

This can be caused by doing lazy replaces on large parent elements like this:

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

Instead you should be more specific and target the specific elements inside the container, such as:

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

Perhaps that's not your issues but I've seen it happen before this way. Let me know.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文