How do I get a 16 column responsive layout with Twitter Bootstrap 2?

好久不见. 提交于 2019-12-23 11:05:08

问题


I'm getting mixed signals from various forum posts. Does it exist natively by changing:

// Default 940px grid
// -------------------------
@gridColumns:             12;
@gridColumnWidth:         60px;
@gridGutterWidth:         20px;
@gridRowWidth:            (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1));

to

// Default 940px grid
// -------------------------
@gridColumns:             16;
@gridColumnWidth:         40px;
@gridGutterWidth:         10px;
@gridRowWidth:            (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1));

Is that all I need to do to create a 16 column layout? I've seen some forum posts saying that you have to go hard-code in selectors span11-16 for it to work because those no longer exist since Bootstrap 2.0 and can't be dynamically created.


回答1:


Well I just tried and it generates 16 columns fine. Have you looked at this page and tried customizing your download?

http://twitter.github.com/bootstrap/download.html

Also, if you take a look at line 556 of the mixins (The Grid), you'll see the function that generates the spans. It takes the total column count into account when generating the spans.

https://github.com/twitter/bootstrap/blob/master/less/mixins.less

In other words, you're good to go.



来源:https://stackoverflow.com/questions/10233260/how-do-i-get-a-16-column-responsive-layout-with-twitter-bootstrap-2

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