javascript - fixed width columns in zurb foundation 3 - Stack Overflow

How do i implement a fixed column gridin zurb foundation 3? Currently, foundation's grid is flui

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 badges
Add a ment  | 

2 Answers 2

Reset to default 4

You 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; }
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744408432a4572748.html

相关推荐

  • javascript - fixed width columns in zurb foundation 3 - Stack Overflow

    How do i implement a fixed column gridin zurb foundation 3? Currently, foundation's grid is flui

    6天前
    60

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信