admin管理员组文章数量:1403334
How do i implement a fixed column grid in zurb foundation 3? Currently, foundation's grid is fluid and are based on percentages. I want to implement something similar to the bootstrap (non-fluid) grid whereby there are only 4 posibilites on how your grid is displayed (well at least until it drops down to mobile, which is fluid)
I want to keep the functionalities (and semantics) of the foundation grid so i dont want to simply swap it out for the bootstrap grid.
I know this goes against the theory of a pure "responsive" grid but dealing with real world clients and their demands has made me lean towards having a finite set of grid behaviours that are predictable (adaptive grid?)
How do i implement a fixed column grid in zurb foundation 3? Currently, foundation's grid is fluid and are based on percentages. I want to implement something similar to the bootstrap (non-fluid) grid whereby there are only 4 posibilites on how your grid is displayed (well at least until it drops down to mobile, which is fluid)
I want to keep the functionalities (and semantics) of the foundation grid so i dont want to simply swap it out for the bootstrap grid.
I know this goes against the theory of a pure "responsive" grid but dealing with real world clients and their demands has made me lean towards having a finite set of grid behaviours that are predictable (adaptive grid?)
Share Improve this question edited Sep 17, 2012 at 15:46 Jeele Yah asked Sep 14, 2012 at 5:43 Jeele YahJeele Yah 4571 gold badge7 silver badges12 bronze badges2 Answers
Reset to default 4You need to reset the columns and row widths in the CSS to fixed positions in an override @media declaration. For instance where you have
.row { width: 100%;}
.one, .row .one { width: 8.33333%; }
.two, .row .two { width: 16.66667%; }
.three, .row .three { width: 25%; }
you would now need,
@media screen and min-width(960px){
.row { width: 960px;}
.one, .row .one { width: 80px /* 960 x 8.33333% */ }
.two, .row .two { width: 160px; /* 960 x 8.33333% */}
.three, .row .three { width: 240px; /* 960 x 8.33333% */}
}
Below was the previous answer before the updated question.
Add a wrapper div around the page
<div class="wrapper">
<!-- Page content and styles go here -->
</div>
and then in your CSS you should include
.wrapper {
width: 98%;
max-width: 1200px;
}
In order to prevent row scaling you need to put the following into your app.css
:
.row { max-width: none; }
This will make row width fixed for all viewports above 767px (767px is default mobile grid breakpoint).
In case you need your grid adjustable in several fixed steps try using media queries:
@media screen and (min-width: 768px) and (max-width: 940px) {
.row { width: 840px; }
}
@media screen and (min-width: 941px) and (max-width: 1050px) {
.row { width: 960px; }
}
本文标签: javascriptfixed width columns in zurb foundation 3Stack Overflow
版权声明:本文标题:javascript - fixed width columns in zurb foundation 3 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744408431a2604823.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论