我已经开始使用苏西,它的能力给我留下了深刻的印象。目前,我正在创建一个网络,其中我有4个媒体查询:
$mobile: 767px;
$tablet: 768px;
$small: 960px;
$large: 1200px;对于最后两个$small和$large,我希望在px和10中有两个宽度固定的列。我不想在% bacause中使用排水沟,因为我想确保所有浏览器的结果都是相同的。
因此,对于固定的colomnus,我使用susy-断点。
@include susy-breakpoint($small, 24 1/1.5 split) {
.container {
@include container($small);
}
.main{
.navigationWrap{
@include span(24);
}
.articleWrap {
@include span(668px);
}
.advertisment {
@include span(240px);
.advBanner{
float: right;
}
}
}
} // END of 960px mq
@include susy-breakpoint($large, 24 1/1.5 split) {
.container {
@include container($large);
}
.main{
.navigationWrap{
@include span(24);//span(4);
}
.articleWrap {
@include span(900px);
}
}
} // END of 1200px mq那么,我的主要问题是:有什么方法和最佳实践可以使排水沟得到修正而不是%(比如1/1.5)来对网格进行更多的控制?
因为没有人回答,所以我用“我自己的方式”来得到固定的排水沟和洞穴。
设置如下:
$susy: (
columns: 24,
column-width: 40px,
gutter-width: 10px,
grid-padding: 10px,
gutter-position: split,
global-box-sizing: content-box,
math: static
);和主要的scss:
//from 960px to 1200
@include breakpoint($small) {
.container {
@include container($small);
}
.header{
.header-logoWrap{
@include span(242px);
}
.header-bannerWrap {
@include span(678px);
img {
float: right;
}
}
}
.main{
.navigationWrap{
@include span(930px);
}
.articleWrap {
@include span(670px);
}
.advertisment {
@include span(250px);
.advBanner{
float: right;
}
}
}
} // END 960px to 1200
// from 1200 final
@include breakpoint($large) {
.container {
@include container($large);
}
.header{
.header-logoWrap{
@include span(242px);
}
.header-bannerWrap {
@include span(918px);
img {
float: right;
}
}
}
.main{
.navigationWrap{
@include span(1170px);
}
.articleWrap {
@include span(910px);
}
.advertisment {
@include span(250px);
.advBanner{
float: right;
}
}
}
} // END of 1200px mq但主要问题仍未解决:-what是固定网格和排水沟的最佳实践吗?
在我建议的代码中,我正在使用
span( px)
如果不使用%中列的span,如何设置$susy
列: 24,列宽:40 24,
发布于 2014-06-22 21:19:54
您的设置映射使用的是susy1和susy2术语的混合。大部分这些设置都被Susy忽略了。我想这就是你想要的:
$susy: (
columns: 24,
column-width: 40px,
gutters: 10px/40px,
gutter-position: split,
global-box-sizing: content-box,
math: static
);gutters设置总是相对的,但是输出不会是--因为您使用的是static数学。在流体网格中也可以有静态排水沟,但这是另一个问题。在边缘没有名为gutter-width或grid-padding', so those have been removed. Split gutters will leave you with half-gutter padding on the grid (5px). If you want a full10 5px的设置,您可以这样做:
.container {
padding: 0 gutters();
}https://stackoverflow.com/questions/24238884
复制相似问题