为什么我的 sIFR 文本没有在液体设计上换行?

发布于 2024-07-16 10:07:48 字数 713 浏览 12 评论 0原文

我有一行简单的文本,我将其替换为 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 技术交流群。

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

发布评论

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

评论(2

鹊巢 2024-07-23 10:07:48

sIFR 3 应该可以解决这个问题。

sIFR 3 should fix this.

习ぎ惯性依靠 2024-07-23 10:07:48

我遇到了类似的问题,将 position:relative 添加到 CSS 中可能会解决它。

I had a similar problem, adding position:relative to your CSS might fix it.

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