PART 1: Rant
I hate bootstrappers using html div classes as a presentation layer to their HTML!!! I applaud you looking to program your site correctly.
It reminds me of the 90s and early 2000s when we were all building websites with tables... are we going backwards people?
<div class="col-6 col-lg-6 col-sm-6">6</div>
<div class="col-6 col-lg-6 col-sm-6">6</div>
vs
<table><tr><td>6</td><td>6</td></tr></table>
I'm waiting for the day that Google imposes penalties on non-semantic markup.
PART 2: Solution
Anyhow, pulling this back to the question...
For bootstrap 3, as far as I am aware, you cannot use .make-column(6)
etc... as per Bass Jobsen's answer because you need to specify the size of the window / screen. lg
/ md
/ sm
/ xs
Here is how I would do it...
main.less
@import 'bootstrap.less';
.wrapper {
.container;
.make-row();
.clearfix();
}
.content-main { // Change these for each window size
.make-lg-column(6);
.make-md-column(6);
.make-sm-column(6);
.make-xs-column(6);
}
.content-sidebar { // change these for each window size
.make-lg-column(6);
.make-md-column(6);
.make-sm-column(6);
.make-xs-column(6);
}
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<style rel="stylesheet/less" src="less/main.less" />
<script src="js/less-1.4.1.min.js" type="text/javascript"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="assets/js/html5shiv.js"></script>
<script src="assets/js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="wrapper">
<div class="content-main">
<div class="page-title">
<!-- Page Title Stuff -->
</div>
<div class="page-content">
<!-- Page Content Stuff -->
</div>
</div>
<div class="content-sidebar"><!-- Page Footer Stuff --></div>
</div>
</body>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…