What values I should set in twitter bootstrap for a fixed 960px layout?

你说的曾经没有我的故事 提交于 2019-12-07 06:29:56

问题


I'm using twitter bootstrap with less cloned from github. I want to set grid width variables because I need a 960px fixed layout. Default values for 940px width are:

@gridColumns:             12;
@gridColumnWidth:         60px;
@gridGutterWidth:         20px;

What values I should set for a fixed 960px layout?

I tried with this, but result was 950px:

@gridColumns:             12;
@gridColumnWidth:         70px;
@gridGutterWidth:         10px;

回答1:


Solve the equation

You need to find a solution(s) for the equasion. One of them is:

@gridColumns:             12;
@gridColumnWidth:         69px;
@gridGutterWidth:         12px;

another one:

@gridColumns:             12;
@gridColumnWidth:         58px;
@gridGutterWidth:         24px;

But use default

Bootstrap was designed for 960px width, it just doesn't specify additional margin/padding on the sides:

| ------------------------------ 960px width ---------------------------------- |
10px left margin | ------------- 940px container ------------ | 10px right margin

So I suggest you to use the default values, if you are targeting 960px.




回答2:


You could always make a 960px container and use fluid.



来源:https://stackoverflow.com/questions/12282744/what-values-i-should-set-in-twitter-bootstrap-for-a-fixed-960px-layout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!