gpt4 book ai didi

css - 如何正确定义嵌套元素?

转载 作者:行者123 更新时间:2023-11-28 07:52:20 27 4
gpt4 key购买 nike

鉴于我有以下标记:

<body>
<article>
<div class="foo">Foo</div>
<div class="bar">Bar</div>
</article>
</body>

body 的宽度固定为 910px:

body { @include container(910px); }

body 有一个 article 元素,它由 2 个嵌套的 divs(.foo >.bar).

此时,如果我想让.foo.bar各占6列。这很容易做到:

article {
@include container

.foo { @include span(6 of 12) }
.bar { @include span(6 of 12) }
}

body@include container 和后续元素 (article) 是否可以包含另一个 @include 容器 直接?

在 Twitter Bootstrap 中,col 应该始终跟在 row 之后。但这不是 Bootstrap。我是苏西。

在Susy中,rowcol是什么概念?还是 @include span 基本上两者都做?

最佳答案

Bootstrap 使用行来移除边缘间距。 Susy 不使用或要求行,因此 span() 就是您所需要的。也不需要重复的 container() 混合。如果您希望文章清除 float ,您可以改用 clearfix(我们的称为 susy-clearfix())。

关于css - 如何正确定义嵌套元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30320849/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com