制作三列布局,使用 yui-grids 固定侧边栏

发布于 2024-07-22 04:15:35 字数 123 浏览 5 评论 0原文

我一直在尝试这样做,但没有取得多大成功。

我如何使用 yui-grids 制作一个像 yui-t1 这样的模板(左侧边栏为 160px),但右侧也有一个相同宽度的边栏?

中心柱应该是液体...

I,ve been trying to do this without much success.

How can I, using yui-grids make a template like yui-t1 (the one with a sidebar of 160px in the left), but with also a sidebar to the right of the same width?

The center column should be liquid...

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

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

发布评论

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

评论(5

东北女汉子 2024-07-29 04:15:35

您可以尝试一下液体布局吗?

You could try this liquid layout instead?

烏雲後面有陽光 2024-07-29 04:15:35

您可以调整和扩展此示例。 这是 200px 固定/流动内容/布局预设列的 HTML:

<div id="bd">
    <div id="yui-main">
        <div class="yui-b yui-b1">
            <div class="yui-u-main">
                <div class="yui-u">
                    <p>Main column: fluid width</p>
                </div>
            </div>
            <div class="yui-u">
                <p>Left column: 200px fixed</b>
            </div>
        </div>
    </div>
    <div class="yui-b">
        <p>Third column: fixed width, follows template preset.</p>
    </div>
</div>

CSS 很简单:

.yui-b1 .yui-u-main {
    float: left;
    width: 100%;
}
.yui-b1 .yui-u {
    float: left;
    /* Width of left column */
    width: 200px;
    margin-left: -100%;
}
.yui-b1 .yui-u-main .yui-u {
    float: none;
    width: auto;
    /* Width of left column + 13px margin (default YUI margin) */
    margin-left: 213px;
}

You can adapt and extend this example. Here's the HTML for 200px fixed / fluid content / layout preset column:

<div id="bd">
    <div id="yui-main">
        <div class="yui-b yui-b1">
            <div class="yui-u-main">
                <div class="yui-u">
                    <p>Main column: fluid width</p>
                </div>
            </div>
            <div class="yui-u">
                <p>Left column: 200px fixed</b>
            </div>
        </div>
    </div>
    <div class="yui-b">
        <p>Third column: fixed width, follows template preset.</p>
    </div>
</div>

CSS is simple as:

.yui-b1 .yui-u-main {
    float: left;
    width: 100%;
}
.yui-b1 .yui-u {
    float: left;
    /* Width of left column */
    width: 200px;
    margin-left: -100%;
}
.yui-b1 .yui-u-main .yui-u {
    float: none;
    width: auto;
    /* Width of left column + 13px margin (default YUI margin) */
    margin-left: 213px;
}
メ斷腸人バ 2024-07-29 04:15:35

根据此页面,180px宽的右侧边栏有默认类 yui-t4。 我假设您可以进入 CSS 并将此像素值更改为 160。

According to this page, a 180px-wide right sidebar has the default class yui-t4. I assume you could go into the CSS and change this pixel value to 160.

万劫不复 2024-07-29 04:15:35

你选择了马修的答案,但他没有回答你的问题。 尽管他可能已经解决了您的问题,但将来阅读此问题的人可能仍然想知道答案。 在我看来,这类事情阻止了一些人给出或制定答案和答案。 会迫使其他人重复这个问题。

You chose Matthew's answer but he didn't answer your question. Though he may have solved your problem, someone reading this question in the future may still want to know the answer. This sort of thing, seems to me,discourages some from giving or developing an answer & would compel someone else to repeat this question.

别把无礼当个性 2024-07-29 04:15:35

您是否尝试过使用 YUI 网格布局 http://developer.yahoo。 com/yui/examples/grids/grids-gb_source.html

,然后在第二个 yui-u 上添加一个名为 .main 的额外类或 .last< 类/code> 到第三个 yui-u。

您可以添加以下覆盖样式

.yui-gb .yui-u {
width: 19%;
}

.yui-gb .main {
  width: 59%;
}

来获得宽度为 19/59/19 的 3 列,

这对您有用吗?

Have you tried using the YUI grids layout http://developer.yahoo.com/yui/examples/grids/grids-gb_source.html

but then adding an extra class on to the 2nd yui-u called .main or a class of .last on to the 3rd yui-u.

You could add the below overwriting style of

.yui-gb .yui-u {
width: 19%;
}

.yui-gb .main {
  width: 59%;
}

to get 3 cols with widths 19/59/19

That any use to you?

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