为什么我的 sIFR 文本没有在液体设计上换行?
我有一行简单的文本,我将其替换为 sIFR 作为我网站上的标题。 该网站是流动的,因此当浏览器窗口改变宽度时它会缩放。 但是当我缩小浏览器窗口时,替代文本(当我打开它进行测试时)会换行到另一行,但 sIFR 文本不会。
我在网络上的其他地方看到人们在 sifr.js 代码中实现了一个 preventWrap=false
函数,但作为 JavaScript 新手,我不确定将其放在哪里才能使其工作。
这是相关的 CSS:
.sIFR-hasFlash h2 {
visibility: hidden;
letter-spacing: 1px;
font-size: 18px;
text-align: center;
line-height: 1.5em;
}
以及相关的 JavaScript:
sIFR.replaceElement(named({sSelector: "h2",
sFlashSrc: "flash/h2_font.swf", sBgColor: "#006633",
sColor: "#FFFFFF", sFlashVars: "textalign=center", sWmode: "transparent"}));
不确定我会将 preventWrap=false
放在哪里,或者这是否是正确的方法。
I have a simple line of text I'm replacing with sIFR for a header on my site. The site is liquid so it scales when the browser window changes width. But when I shrink the browser window down, the alt text (when I turn it on for testing) wraps to another line, but the sIFR text doesn't.
I've seen written elsewhere on the web that people implement in the sifr.js code a preventWrap=false
function, but being new to JavaScript I'm not sure where to put it to make it work.
Here's the relevant CSS:
.sIFR-hasFlash h2 {
visibility: hidden;
letter-spacing: 1px;
font-size: 18px;
text-align: center;
line-height: 1.5em;
}
And the relevant JavaScript:
sIFR.replaceElement(named({sSelector: "h2",
sFlashSrc: "flash/h2_font.swf", sBgColor: "#006633",
sColor: "#FFFFFF", sFlashVars: "textalign=center", sWmode: "transparent"}));
Not sure where I would put the preventWrap=false
, or if that's even the way to go.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
sIFR 3 应该可以解决这个问题。
sIFR 3 should fix this.
我遇到了类似的问题,将 position:relative 添加到 CSS 中可能会解决它。
I had a similar problem, adding position:relative to your CSS might fix it.