How do I get a 16 column responsive layout with Tw

2019-06-21 14:34发布

问题:

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.