sIFR 将一个单词分成两行?

发布于 2024-08-02 10:10:11 字数 236 浏览 3 评论 0原文

有人对此有任何解释吗?我尝试在 #menu_wrapper ul li 上设置宽度,但无济于事。

http: //i31.tinypic.com/2vskbqu.png

Does anyone have any explanation for this? I've tried setting a width on #menu_wrapper ul li to no avail.

http://i31.tinypic.com/2vskbqu.png

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

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

发布评论

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

评论(3

青芜 2024-08-09 10:10:11

sIFR 的宽度限制为您要替换的元素的宽度。如果该元素是浮动的,则宽度是 HTML 文本的实际宽度。如果 Flash 字体比 HTML 字体宽,则意味着 Flash 文本将无法适应允许的宽度并分成多行。

可能的解决方案:

  • 为列表项指定 letter-spacing,使 HTML 文本与 Flash 文本一样宽
  • sIFR.replace() 设置 forceSingleLine 参数true,缺点是 Flash 影片在初始化时会显示水平调整大小
  • 结合这两种解决方案以获得更好的初始化性能,以及文本永远不会分裂的安全性

sIFR is limited in width to the width of the element you're replacing. If this element is floated, the width is the actual width of the HTML text. If the Flash font is wider than the HTML font, this means the Flash text won't fit in the allowed width and splits into multiple lines.

Possible solutions:

  • Specify letter-spacing for the list items, such that the HTML text is as wide as the Flash text
  • Set forceSingleLine parameter for sIFR.replace() to true, with as downside that the Flash movies will show horizontal resizing as they are initialized
  • Combine the two solutions to get better initialization performance, and the security that the text will never split
是伱的 2024-08-09 10:10:11

sIFR 计算要应用它的元素的尺寸。浮动元素被收缩包裹,仅占据显示内部文本所需的宽度。

我建议您为每个 lis 提供一个 id,例如

li#nav-blog { width:200px; }

This 可以让您更好地控制每个导航列表元素占用的区域,以及 sIFR 使用的更多空间。

sIFR calculates the dimensions of the element you're applying it to. Floated elements are shrinkwrapped and take up only the width in which its necessary for the text inside to display.

I suggest you give an id to each of those lis, something like

li#nav-blog { width:200px; }

This will give you finer control over how much area each of those nav list elements take up, and more space for sIFR to use.

紫轩蝶泪 2024-08-09 10:10:11

我的解决方案:

sIFR.replace(gothic, {
   wmode: 'transparent',
   forceSingleLine: true,
   selector: '.quick-access li h2 a',
   css: [
        '.sIFR-root { background-color: transparent; font-size:24px;  color: #abaaab; text-align: center; cursor: pointer;}',
        'a {background-color: transparent; font-size:24px;  color: #abaaab; text-decoration:none; text-align: center; cursor: pointer;}',
        'a:hover {background-color: transparent; font-size:24px;  color: #77b100; text-decoration:none; text-align: center; cursor: pointer;}'
        ],
});

和CSS:

h2 {
    font-size: 18px;
    font-weight: normal;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.35;
    margin: 0 0 5px;
}

*{
    margin: 0;
    padding: 0;
}

My solution:

sIFR.replace(gothic, {
   wmode: 'transparent',
   forceSingleLine: true,
   selector: '.quick-access li h2 a',
   css: [
        '.sIFR-root { background-color: transparent; font-size:24px;  color: #abaaab; text-align: center; cursor: pointer;}',
        'a {background-color: transparent; font-size:24px;  color: #abaaab; text-decoration:none; text-align: center; cursor: pointer;}',
        'a:hover {background-color: transparent; font-size:24px;  color: #77b100; text-decoration:none; text-align: center; cursor: pointer;}'
        ],
});

And CSS:

h2 {
    font-size: 18px;
    font-weight: normal;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.35;
    margin: 0 0 5px;
}

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