仅 PC 版 Firefox 3 中的文本换行不一致
这是我在 Firefox 3.0 中反复出现的问题。 似乎当我不断刷新时,有时它会换行,有时则不会。 当它不换行时,我可以调整窗口大小,并且 sIFR'd 元素将捕捉到其正确的大小。 我需要根据容器的宽度在加载时包裹元素。
我有最新的 sIFR 3.0 的“每晚构建”。
我想 sIFR h2 标签。 h2 标签包含在 div 中,并且两者都有设定的宽度。
<div class="recipe-title">
<h2>This is a recipe title</h2>
</div>
在我的 sifr.js 文件中,我设置了以下参数:
forceWidth = true;
fitExactly = true;
preventWrap = false;
我的 .sifr.CSS 文件看起来像这样:
@media screen {
.sIFR-active .recipe-title h2 { width:455px; font-size:16px; text-transform:uppercase; }
}
我的普通 CSS 文件看起来像这样:
.recipe-title, .recipe-title h2 { width:400px; }
除了 PC 上的 FF3 之外,其他所有内容似乎都适用于所有其他浏览器。 这是一个已知的错误?
This is a recurring problem I have in Firefox 3.0. It seems when I keep refreshing sometimes it wraps, sometimes it doesn't. When it doesn't wrap, I can adjust the window size and the sIFR'd element will snap to its correct size. I need my elements to wrap on load, based on the width of it's container.
I have the most current 'nightly build' of sIFR 3.0.
I want to sIFR a h2 tag. The h2 tag is enclosed in a div, and both have set widths.
<div class="recipe-title">
<h2>This is a recipe title</h2>
</div>
In my sifr.js file, I have the following parameters set:
forceWidth = true;
fitExactly = true;
preventWrap = false;
My .sifr.CSS file looks like this:
@media screen {
.sIFR-active .recipe-title h2 { width:455px; font-size:16px; text-transform:uppercase; }
}
And my normal CSS file looks like this:
.recipe-title, .recipe-title h2 { width:400px; }
Everything else seems to work in all other browsers except for FF3 on PC only. Is this a known bug?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
sIFR 可能初始化得太早。 最简单的修复方法是在
sIFR.activate()
之前设置sIFR.useDomLoaded = false;
,这将等到页面加载后再替换元素。您还可以考虑使用 sIFR.useStyleCheck = true;,它需要更多的 CSS,但会等到 CSS 加载完成。
sIFR may be initializing too early. Easiest fix is to set
sIFR.useDomLoaded = false;
beforesIFR.activate()
, which will wait until page load before replacing the elements.You can also look into using
sIFR.useStyleCheck = true;
which needs a bit more CSS but will wait until the CSS has loaded.我很确定它是 text-transform:uppercase 在设置 Flash 宽度后放大字宽
我已经尝试找到解决方案一段时间了
I'm pretty sure it's text-transform:uppercase enlarging the word width after the flash width has been set
I've been trying to figure a solution to this for some time
对于普通用户...请确保为您的对象或图像设置 div 容器的宽度和高度。 如果未设置这些值,Firefox 将换行后面的所有文本。
For the common user... make sure that you set your width and height of the div container for your object or image. Firefox will wrap any text following if these values are not set.
一种可能性是您可能需要指定元素的高度。 IE7 也可能有类似的问题。
A possibility is that you might need to specify a height on the element. IE7 can have a similar problem.
sIFR.activate() 位于 sifr.js 文件还是 sifr-addons.js 文件中?
Is sIFR.activate() located in the sifr.js file or the sifr-addons.js file?
根据马克的建议,在 sIFR.activate() 对我有用之前取消注释 sIFR.useStyleCheck = true; 。
罗伯特,sIFR.activate() 可在 sifr.js 中找到。
Per Mark's advice, uncommenting sIFR.useStyleCheck = true; just before sIFR.activate() worked for me.
Robert, sIFR.activate() is found in sifr.js.