I have a simple layout using bootstrap which gives me 2 columns - one LEFT and one RIGHT. Using the 12 column grid format of Bootstrap - the left should be 8 wide and the right column 4 wide like below.
<div class="row">
<div class="col-md-8">Left Content</div>
<div class="col-md-4">Right Content</div>
</div>
The problem? How can i add a CONTAINER to the row so things are centered BUT give the right column a background color that stretches all the way to the edge of the browser. So if left background color is blue and right background is pink, the colors run full width whilst keeping content within them centered via the container.
BOOTPLY
Easy.
Working solution: https://jsfiddle.net/qbe2k1he/
/** Custom CSS **/
body {
background-color: #4E8FD8;
overflow-x: hidden;
}
.content, .sidebar {
border: 1px solid white;
color: white;
padding: 20px;
text-transform: uppercase;
min-height: 500px;
}
.content {
min-height: 2000px;
}
.sidebar::before {
content: '';
position: fixed;
top: 0;
width: 100vw;
height: 100vh;
background: #DB4ECB;
z-index: -1;
margin-left: -35px;
}
#media screen and (max-width: 991px) {
.sidebar::before {
display: none;
}
}
/** Bootstrap Grid **/
#-ms-viewport {
width: device-width;
}
.visible-xs,
.visible-sm,
.visible-md,
.visible-lg {
display: none !important;
}
.visible-xs-block,
.visible-xs-inline,
.visible-xs-inline-block,
.visible-sm-block,
.visible-sm-inline,
.visible-sm-inline-block,
.visible-md-block,
.visible-md-inline,
.visible-md-inline-block,
.visible-lg-block,
.visible-lg-inline,
.visible-lg-inline-block {
display: none !important;
}
#media (max-width: 767px) {
.visible-xs {
display: block !important;
}
table.visible-xs {
display: table;
}
tr.visible-xs {
display: table-row !important;
}
th.visible-xs,
td.visible-xs {
display: table-cell !important;
}
}
#media (max-width: 767px) {
.visible-xs-block {
display: block !important;
}
}
#media (max-width: 767px) {
.visible-xs-inline {
display: inline !important;
}
}
#media (max-width: 767px) {
.visible-xs-inline-block {
display: inline-block !important;
}
}
#media (min-width: 768px) and (max-width: 991px) {
.visible-sm {
display: block !important;
}
table.visible-sm {
display: table;
}
tr.visible-sm {
display: table-row !important;
}
th.visible-sm,
td.visible-sm {
display: table-cell !important;
}
}
#media (min-width: 768px) and (max-width: 991px) {
.visible-sm-block {
display: block !important;
}
}
#media (min-width: 768px) and (max-width: 991px) {
.visible-sm-inline {
display: inline !important;
}
}
#media (min-width: 768px) and (max-width: 991px) {
.visible-sm-inline-block {
display: inline-block !important;
}
}
#media (min-width: 992px) and (max-width: 1199px) {
.visible-md {
display: block !important;
}
table.visible-md {
display: table;
}
tr.visible-md {
display: table-row !important;
}
th.visible-md,
td.visible-md {
display: table-cell !important;
}
}
#media (min-width: 992px) and (max-width: 1199px) {
.visible-md-block {
display: block !important;
}
}
#media (min-width: 992px) and (max-width: 1199px) {
.visible-md-inline {
display: inline !important;
}
}
#media (min-width: 992px) and (max-width: 1199px) {
.visible-md-inline-block {
display: inline-block !important;
}
}
#media (min-width: 1200px) {
.visible-lg {
display: block !important;
}
table.visible-lg {
display: table;
}
tr.visible-lg {
display: table-row !important;
}
th.visible-lg,
td.visible-lg {
display: table-cell !important;
}
}
#media (min-width: 1200px) {
.visible-lg-block {
display: block !important;
}
}
#media (min-width: 1200px) {
.visible-lg-inline {
display: inline !important;
}
}
#media (min-width: 1200px) {
.visible-lg-inline-block {
display: inline-block !important;
}
}
#media (max-width: 767px) {
.hidden-xs {
display: none !important;
}
}
#media (min-width: 768px) and (max-width: 991px) {
.hidden-sm {
display: none !important;
}
}
#media (min-width: 992px) and (max-width: 1199px) {
.hidden-md {
display: none !important;
}
}
#media (min-width: 1200px) {
.hidden-lg {
display: none !important;
}
}
.visible-print {
display: none !important;
}
#media print {
.visible-print {
display: block !important;
}
table.visible-print {
display: table;
}
tr.visible-print {
display: table-row !important;
}
th.visible-print,
td.visible-print {
display: table-cell !important;
}
}
.visible-print-block {
display: none !important;
}
#media print {
.visible-print-block {
display: block !important;
}
}
.visible-print-inline {
display: none !important;
}
#media print {
.visible-print-inline {
display: inline !important;
}
}
.visible-print-inline-block {
display: none !important;
}
#media print {
.visible-print-inline-block {
display: inline-block !important;
}
}
#media print {
.hidden-print {
display: none !important;
}
}
.container {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
#media (min-width: 768px) {
.container {
width: 750px;
}
}
#media (min-width: 992px) {
.container {
width: 970px;
}
}
#media (min-width: 1200px) {
.container {
width: 1170px;
}
}
.container-fluid {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
.row {
margin-left: -15px;
margin-right: -15px;
}
.col, .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
.col, .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
float: left;
}
.col-xs-12 {
width: 100%;
}
.col-xs-11 {
width: 91.66666667%;
}
.col-xs-10 {
width: 83.33333333%;
}
.col-xs-9 {
width: 75%;
}
.col-xs-8 {
width: 66.66666667%;
}
.col-xs-7 {
width: 58.33333333%;
}
.col-xs-6 {
width: 50%;
}
.col-xs-5 {
width: 41.66666667%;
}
.col-xs-4 {
width: 33.33333333%;
}
.col-xs-3 {
width: 25%;
}
.col-xs-2 {
width: 16.66666667%;
}
.col-xs-1 {
width: 8.33333333%;
}
.col-xs-pull-12 {
right: 100%;
}
.col-xs-pull-11 {
right: 91.66666667%;
}
.col-xs-pull-10 {
right: 83.33333333%;
}
.col-xs-pull-9 {
right: 75%;
}
.col-xs-pull-8 {
right: 66.66666667%;
}
.col-xs-pull-7 {
right: 58.33333333%;
}
.col-xs-pull-6 {
right: 50%;
}
.col-xs-pull-5 {
right: 41.66666667%;
}
.col-xs-pull-4 {
right: 33.33333333%;
}
.col-xs-pull-3 {
right: 25%;
}
.col-xs-pull-2 {
right: 16.66666667%;
}
.col-xs-pull-1 {
right: 8.33333333%;
}
.col-xs-pull-0 {
right: auto;
}
.col-xs-push-12 {
left: 100%;
}
.col-xs-push-11 {
left: 91.66666667%;
}
.col-xs-push-10 {
left: 83.33333333%;
}
.col-xs-push-9 {
left: 75%;
}
.col-xs-push-8 {
left: 66.66666667%;
}
.col-xs-push-7 {
left: 58.33333333%;
}
.col-xs-push-6 {
left: 50%;
}
.col-xs-push-5 {
left: 41.66666667%;
}
.col-xs-push-4 {
left: 33.33333333%;
}
.col-xs-push-3 {
left: 25%;
}
.col-xs-push-2 {
left: 16.66666667%;
}
.col-xs-push-1 {
left: 8.33333333%;
}
.col-xs-push-0 {
left: auto;
}
.col-xs-offset-12 {
margin-left: 100%;
}
.col-xs-offset-11 {
margin-left: 91.66666667%;
}
.col-xs-offset-10 {
margin-left: 83.33333333%;
}
.col-xs-offset-9 {
margin-left: 75%;
}
.col-xs-offset-8 {
margin-left: 66.66666667%;
}
.col-xs-offset-7 {
margin-left: 58.33333333%;
}
.col-xs-offset-6 {
margin-left: 50%;
}
.col-xs-offset-5 {
margin-left: 41.66666667%;
}
.col-xs-offset-4 {
margin-left: 33.33333333%;
}
.col-xs-offset-3 {
margin-left: 25%;
}
.col-xs-offset-2 {
margin-left: 16.66666667%;
}
.col-xs-offset-1 {
margin-left: 8.33333333%;
}
.col-xs-offset-0 {
margin-left: 0%;
}
#media (min-width: 768px) {
.col, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
float: left;
}
.col-sm-12 {
width: 100%;
}
.col-sm-11 {
width: 91.66666667%;
}
.col-sm-10 {
width: 83.33333333%;
}
.col-sm-9 {
width: 75%;
}
.col-sm-8 {
width: 66.66666667%;
}
.col-sm-7 {
width: 58.33333333%;
}
.col-sm-6 {
width: 50%;
}
.col-sm-5 {
width: 41.66666667%;
}
.col-sm-4 {
width: 33.33333333%;
}
.col-sm-3 {
width: 25%;
}
.col-sm-2 {
width: 16.66666667%;
}
.col-sm-1 {
width: 8.33333333%;
}
.col-sm-pull-12 {
right: 100%;
}
.col-sm-pull-11 {
right: 91.66666667%;
}
.col-sm-pull-10 {
right: 83.33333333%;
}
.col-sm-pull-9 {
right: 75%;
}
.col-sm-pull-8 {
right: 66.66666667%;
}
.col-sm-pull-7 {
right: 58.33333333%;
}
.col-sm-pull-6 {
right: 50%;
}
.col-sm-pull-5 {
right: 41.66666667%;
}
.col-sm-pull-4 {
right: 33.33333333%;
}
.col-sm-pull-3 {
right: 25%;
}
.col-sm-pull-2 {
right: 16.66666667%;
}
.col-sm-pull-1 {
right: 8.33333333%;
}
.col-sm-pull-0 {
right: auto;
}
.col-sm-push-12 {
left: 100%;
}
.col-sm-push-11 {
left: 91.66666667%;
}
.col-sm-push-10 {
left: 83.33333333%;
}
.col-sm-push-9 {
left: 75%;
}
.col-sm-push-8 {
left: 66.66666667%;
}
.col-sm-push-7 {
left: 58.33333333%;
}
.col-sm-push-6 {
left: 50%;
}
.col-sm-push-5 {
left: 41.66666667%;
}
.col-sm-push-4 {
left: 33.33333333%;
}
.col-sm-push-3 {
left: 25%;
}
.col-sm-push-2 {
left: 16.66666667%;
}
.col-sm-push-1 {
left: 8.33333333%;
}
.col-sm-push-0 {
left: auto;
}
.col-sm-offset-12 {
margin-left: 100%;
}
.col-sm-offset-11 {
margin-left: 91.66666667%;
}
.col-sm-offset-10 {
margin-left: 83.33333333%;
}
.col-sm-offset-9 {
margin-left: 75%;
}
.col-sm-offset-8 {
margin-left: 66.66666667%;
}
.col-sm-offset-7 {
margin-left: 58.33333333%;
}
.col-sm-offset-6 {
margin-left: 50%;
}
.col-sm-offset-5 {
margin-left: 41.66666667%;
}
.col-sm-offset-4 {
margin-left: 33.33333333%;
}
.col-sm-offset-3 {
margin-left: 25%;
}
.col-sm-offset-2 {
margin-left: 16.66666667%;
}
.col-sm-offset-1 {
margin-left: 8.33333333%;
}
.col-sm-offset-0 {
margin-left: 0%;
}
}
#media (min-width: 992px) {
.col, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
float: left;
}
.col-md-12 {
width: 100%;
}
.col-md-11 {
width: 91.66666667%;
}
.col-md-10 {
width: 83.33333333%;
}
.col-md-9 {
width: 75%;
}
.col-md-8 {
width: 66.66666667%;
}
.col-md-7 {
width: 58.33333333%;
}
.col-md-6 {
width: 50%;
}
.col-md-5 {
width: 41.66666667%;
}
.col-md-4 {
width: 33.33333333%;
}
.col-md-3 {
width: 25%;
}
.col-md-2 {
width: 16.66666667%;
}
.col-md-1 {
width: 8.33333333%;
}
.col-md-pull-12 {
right: 100%;
}
.col-md-pull-11 {
right: 91.66666667%;
}
.col-md-pull-10 {
right: 83.33333333%;
}
.col-md-pull-9 {
right: 75%;
}
.col-md-pull-8 {
right: 66.66666667%;
}
.col-md-pull-7 {
right: 58.33333333%;
}
.col-md-pull-6 {
right: 50%;
}
.col-md-pull-5 {
right: 41.66666667%;
}
.col-md-pull-4 {
right: 33.33333333%;
}
.col-md-pull-3 {
right: 25%;
}
.col-md-pull-2 {
right: 16.66666667%;
}
.col-md-pull-1 {
right: 8.33333333%;
}
.col-md-pull-0 {
right: auto;
}
.col-md-push-12 {
left: 100%;
}
.col-md-push-11 {
left: 91.66666667%;
}
.col-md-push-10 {
left: 83.33333333%;
}
.col-md-push-9 {
left: 75%;
}
.col-md-push-8 {
left: 66.66666667%;
}
.col-md-push-7 {
left: 58.33333333%;
}
.col-md-push-6 {
left: 50%;
}
.col-md-push-5 {
left: 41.66666667%;
}
.col-md-push-4 {
left: 33.33333333%;
}
.col-md-push-3 {
left: 25%;
}
.col-md-push-2 {
left: 16.66666667%;
}
.col-md-push-1 {
left: 8.33333333%;
}
.col-md-push-0 {
left: auto;
}
.col-md-offset-12 {
margin-left: 100%;
}
.col-md-offset-11 {
margin-left: 91.66666667%;
}
.col-md-offset-10 {
margin-left: 83.33333333%;
}
.col-md-offset-9 {
margin-left: 75%;
}
.col-md-offset-8 {
margin-left: 66.66666667%;
}
.col-md-offset-7 {
margin-left: 58.33333333%;
}
.col-md-offset-6 {
margin-left: 50%;
}
.col-md-offset-5 {
margin-left: 41.66666667%;
}
.col-md-offset-4 {
margin-left: 33.33333333%;
}
.col-md-offset-3 {
margin-left: 25%;
}
.col-md-offset-2 {
margin-left: 16.66666667%;
}
.col-md-offset-1 {
margin-left: 8.33333333%;
}
.col-md-offset-0 {
margin-left: 0%;
}
}
#media (min-width: 1200px) {
.col, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
float: left;
}
.col-lg-12 {
width: 100%;
}
.col-lg-11 {
width: 91.66666667%;
}
.col-lg-10 {
width: 83.33333333%;
}
.col-lg-9 {
width: 75%;
}
.col-lg-8 {
width: 66.66666667%;
}
.col-lg-7 {
width: 58.33333333%;
}
.col-lg-6 {
width: 50%;
}
.col-lg-5 {
width: 41.66666667%;
}
.col-lg-4 {
width: 33.33333333%;
}
.col-lg-3 {
width: 25%;
}
.col-lg-2 {
width: 16.66666667%;
}
.col-lg-1 {
width: 8.33333333%;
}
.col-lg-pull-12 {
right: 100%;
}
.col-lg-pull-11 {
right: 91.66666667%;
}
.col-lg-pull-10 {
right: 83.33333333%;
}
.col-lg-pull-9 {
right: 75%;
}
.col-lg-pull-8 {
right: 66.66666667%;
}
.col-lg-pull-7 {
right: 58.33333333%;
}
.col-lg-pull-6 {
right: 50%;
}
.col-lg-pull-5 {
right: 41.66666667%;
}
.col-lg-pull-4 {
right: 33.33333333%;
}
.col-lg-pull-3 {
right: 25%;
}
.col-lg-pull-2 {
right: 16.66666667%;
}
.col-lg-pull-1 {
right: 8.33333333%;
}
.col-lg-pull-0 {
right: auto;
}
.col-lg-push-12 {
left: 100%;
}
.col-lg-push-11 {
left: 91.66666667%;
}
.col-lg-push-10 {
left: 83.33333333%;
}
.col-lg-push-9 {
left: 75%;
}
.col-lg-push-8 {
left: 66.66666667%;
}
.col-lg-push-7 {
left: 58.33333333%;
}
.col-lg-push-6 {
left: 50%;
}
.col-lg-push-5 {
left: 41.66666667%;
}
.col-lg-push-4 {
left: 33.33333333%;
}
.col-lg-push-3 {
left: 25%;
}
.col-lg-push-2 {
left: 16.66666667%;
}
.col-lg-push-1 {
left: 8.33333333%;
}
.col-lg-push-0 {
left: auto;
}
.col-lg-offset-12 {
margin-left: 100%;
}
.col-lg-offset-11 {
margin-left: 91.66666667%;
}
.col-lg-offset-10 {
margin-left: 83.33333333%;
}
.col-lg-offset-9 {
margin-left: 75%;
}
.col-lg-offset-8 {
margin-left: 66.66666667%;
}
.col-lg-offset-7 {
margin-left: 58.33333333%;
}
.col-lg-offset-6 {
margin-left: 50%;
}
.col-lg-offset-5 {
margin-left: 41.66666667%;
}
.col-lg-offset-4 {
margin-left: 33.33333333%;
}
.col-lg-offset-3 {
margin-left: 25%;
}
.col-lg-offset-2 {
margin-left: 16.66666667%;
}
.col-lg-offset-1 {
margin-left: 8.33333333%;
}
.col-lg-offset-0 {
margin-left: 0%;
}
}
.clearfix,
.clearfix:before,
.clearfix:after,
.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after {
content: " ";
display: table;
}
.clearfix:after,
.container:after,
.container-fluid:after,
.row:after {
clear: both;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
}
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
<div id="wrapper">
<div class="container">
<div class="col-md-9">
<div class="content">
<p>left content</p>
</div>
</div>
<div class="col-md-3">
<div class="sidebar">
<p>right content</p>
</div>
</div>
</div>
</div>
You can try this, it works for me, you have to add an additional css class.
<div class="container col-md-12 nopadding">
<div class="row">
<div class="col-md-8" style="background-color:blue;">Left Content</div>
<div class="col-md-4" style="background-color:pink;">Right Content</div>
</div>
</div>
and CSS as below
.nopadding {
padding: 0 !important;
margin: 0 !important;
}
I'm surprised I found only a few questions like this one. I had a similar requirement and I managed to solve it using a combination of absolute positioned elements and vw units.
Basically, a wrapper element has the background color of the left side to make it look like it extends to the border of the screen and an absolute positioned div with the same width of the viewport extends as background of the right side.
You can see it working in this codepen
Markup goes like this
<div class="wrapper"> <!-- to style bg without with messing with container margins -->
<div class="container">
<div class="row">
<div class="col-md-8 left"></div>
<div class="col-md-4 right">
<div class="bg"><!-- additional element that will act as background --></div>
</div>
</div>
</div>
</div>
And css:
/* Wrapper has the bg color of left side */
.wrapper,
.left {
background-color: blue;
}
/* Right container */
.right {
background-color: pink;
position: relative; /* Let it have absolute positioned children */
z-index: 0;
}
.right .bg {
background-color: pink;
/* Following will make our bg element the same size as its parent
and will put it behind it making it look like a background */
position: absolute;
left: 0;
top: 0;
height: 100%;
z-index: -1;
width: 100%; // fallback for old browsers, bg will be same size as its parent
width: 100vw; // Have the bg the same width as the screen, making the bg hang outside the screen
}
Note that as bg will hang outside the container, you will need the wrapper div or one of its parent to have its overflow-x property as hidden, otherwise horizontal scrolling bars will appear.
If you have some specific elements inside your right column you can even use css pseudo elements like :before to avoid the declaration of the bg element.
Also, you need to set the appropriate screen breakpoints to style this for smaller screen sizes.
you can try this and you can change as you wish, no need additional css.
<div class="container col-md-12">
<div class="row col-md-6 col-md-offset-3">
<div class="col-md-8" style="background-color:blue;">Left Content</div>
<div class="col-md-4" style="background-color:pink;">Right Content</div>
</div>
</div>
Demo here
<div class="_100">
<div class="container col-md-8 nopadding" style="background-color:blue;">
<div class="col-md-8 right nopadding" style="background-color:blue;border:white 1px solid;margin:5px">Left Content</div>
</div>
<div class="container col-md-4 nopadding" style="background-color:pink;">
<div class="col-md-6 nopadding" style="background-color:pink;border:white 1px solid;margin:5px">Right Content</div>
</div>
</div>
css:
.nopadding{padding: 0 !important;margin: 0 !important;}
._100 {width:100%;}
.right{float:right;}
You've got to get pretty specific with your widths, which will get finicky at breakpoint, but this will work as a starting point:
DEMO: http://www.bootply.com/F9PCGnQr6Y
<div class="container bg-grey">Example Container</div>
<div class="col-md-8 bg-info" style="height:100px">
<div class="row">
<div class="left-container bg-warning pull-right" style="height:50px">
<div class="col-xs-12">Left Content - is wider than in-container col-md-8, because it's 8/12ths of full-width</div>
</div>
</div>
</div>
<div class="col-md-4 bg-danger" style="height:100px">
<div class="row">
<div class="right-container bg-success" style="height:50px">
<div class="col-xs-12">Right Content</div>
</div>
</div>
</div>
You'll definitely need to write some custom behaviour at your breakpoint(s), and also may want the internal containers to be col-7 and col-5 since the initial col-8 ends up being very wide within, but those customizations are up to you...
Check my solution. I guess you need this one - codepen
But you need to include bootstrap 4 instead of bootstrap 3
html, body, .wrapper{
height:100%;
}
.wrapper{
padding:10px;
}
.right {
position: relative;
z-index: 0;
padding:0 !important;
}
.wrapper {
background-color: #00a2ff;
overflow-x: hidden;
}
.right:before {
content:"";
background-color: #f7469e;
height: 100%;
position: fixed;
top: 0;
width: 100%;
width: 100vw;
z-index: -1;
}
body {
background-color: #999;
color: #fff;
}
.left, .right {
outline: 1px solid #fff;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.css" rel="stylesheet"/>
<div class="wrapper">
<div class="container">
<div class="row">
<div class="col-8 left">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</div>
<div class="col-4 right">Right Content -THIS CONTENT MUST NOT BE FULL WIDTH. MUST ONLY BE WIDTH OF col-md-4. THE BACKGROUND COLOR must be full-width.</div>
</div>
</div>
</div>
Here's the solution. The blocks are adaptive, you can set any height for both blocks, the height is also set automatically depending on the content. codepen
<section>
<div class="container">
<div class="block block_left">
<div class="block__content">
<p>
С другой стороны консультация с широким активом способствует подготовки и реализации системы обучения кадров, соответствует насущным потребностям.
Не следует, однако забывать, что сложившаяся структура организации требуют от нас анализа системы обучения кадров, соответствует насущным потребностям.
Товарищи! рамки и место обучения кадров требуют от нас анализа существенных финансовых и административных условий.
Товарищи! реализация намеченных плановых заданий играет важную роль в формировании системы обучения кадров, соответствует насущным потребностям.
Идейные соображения высшего порядка, а также новая модель организационной деятельности требуют от нас анализа системы обучения кадров, соответствует насущным потребностям.
Разнообразный и богатый опыт постоянное информационно-пропагандистское обеспечение нашей деятельности представляет собой интересный эксперимент проверки позиций, занимаемых участниками в отношении поставленных задач.
</p>
<p>
Задача организации, в особенности же постоянный количественный рост и сфера нашей активности обеспечивает широкому кругу (специалистов) участие в формировании соответствующий условий активизации.
Не следует, однако забывать, что укрепление и развитие структуры позволяет выполнять важные задания по разработке модели развития.
Таким образом рамки и место обучения кадров требуют определения и уточнения систем массового участия.
Разнообразный и богатый опыт реализация намеченных плановых заданий играет важную роль в формировании дальнейших направлений развития.
</p>
<p>
Таким образом сложившаяся структура организации в значительной степени обуславливает создание модели развития.
Идейные соображения высшего порядка, а также дальнейшее развитие различных форм деятельности в значительной степени обуславливает создание позиций, занимаемых участниками в отношении поставленных задач.
Разнообразный и богатый опыт постоянное информационно-пропагандистское обеспечение нашей деятельности обеспечивает широкому кругу (специалистов) участие в формировании форм развития.
Повседневная практика показывает, что дальнейшее развитие различных форм деятельности способствует подготовки и реализации соответствующий условий активизации.
Идейные соображения высшего порядка, а также реализация намеченных плановых заданий требуют определения и уточнения систем массового участия.
Равным образом реализация намеченных плановых заданий позволяет выполнять важные задания по разработке систем массового участия.
</p>
<p>
Разнообразный и богатый опыт начало повседневной работы по формированию позиции представляет собой интересный эксперимент проверки новых предложений.
Таким образом новая модель организационной деятельности требуют от нас анализа системы обучения кадров, соответствует насущным потребностям.
</p>
<p>
С другой стороны реализация намеченных плановых заданий позволяет выполнять важные задания по разработке форм развития.
Товарищи! начало повседневной работы по формированию позиции требуют определения и уточнения направлений прогрессивного развития.
</p>
<p>
Таким образом сложившаяся структура организации представляет собой интересный эксперимент проверки новых предложений.
Повседневная практика показывает, что постоянное информационно-пропагандистское обеспечение нашей деятельности требуют определения и уточнения форм развития.
</p>
</div>
</div>
<div class="block block_right">
<div class="block__content">
<p>
Таким образом сложившаяся структура организации в значительной степени обуславливает создание модели развития.
Идейные соображения высшего порядка, а также дальнейшее развитие различных форм деятельности в значительной степени обуславливает создание позиций, занимаемых участниками в отношении поставленных задач.
Разнообразный и богатый опыт постоянное информационно-пропагандистское обеспечение нашей деятельности обеспечивает широкому кругу (специалистов) участие в формировании форм развития.
Повседневная практика показывает, что дальнейшее развитие различных форм деятельности способствует подготовки и реализации соответствующий условий активизации.
Идейные соображения высшего порядка, а также реализация намеченных плановых заданий требуют определения и уточнения систем массового участия.
Равным образом реализация намеченных плановых заданий позволяет выполнять важные задания по разработке систем массового участия.
</p>
</div>
</div>
</div>
</section>
<style>
body {
overflow-x: hidden;
margin: 0px;
padding: 0px;
}
.container {
width: 100%;
max-width: 1170px;
margin: 0 auto;
font-size: 0px;
display: flex;
flex-wrap: wrap;
}
.block {
display: inline-block;
font-size: 16px;
box-sizing: border-box;
position: relative;
color: white;
vertical-align: top;
}
.block_left {
width: 70%;
}
.block_right {
width: 30%;
}
.block::before {
content: '';
width: 150vw;
height: 100%;
position: absolute;
right: 0px;
top: 0px;
z-index: -1;
background: #3f80cb;
min-height: 100vh;
}
.block_right:before {
background: #d55bc3;
right: auto;
left: 0px;
}
.block__content {
outline: 1px solid #ffffff91;
margin: 20px;
padding: 1px 10px;
}
#media screen and (max-width: 700px) {
.block {
width: 100%;
}
.block::before {
min-height: 0px;
}
}
</style>
Related
I need this to fill the screen with no scroll bar
#media (min-aspect-ratio: 2/3) and (max-aspect-ratio: 3/2) {
.containerMedia {
columns: 3 auto;
}
.individualBoxMedia{
height: calc(100vh/3);
}
but its like this
but this is working
#media (max-aspect-ratio: 2/3) {
.containerMedia {
columns: 2 auto;
}
.individualBoxMedia{
height: 25vh;
}
}
full code
App.js
//import logo from './images/logo512.png';
import './App.css';
import cardData from './data/cardData';
function App() {
return (
<div className="App">
<div className='container containerMedia'>
{cardData.map(card => {
return (
<div className='individualBox individualBoxMedia'>
<div className='card'>
<div className='cardImageBox'>
<img src={card.location}/>
</div>
<div className='cardTextBox'>
<p>{card.text}</p>
</div>
</div>
</div>
)
})}
</div>
</div>
);
}
export default App;
/*
https://codesandbox.io/s/repeat-element-dpocp?file=/src/App.tsx
*/
app.css
.App {
text-align: center;
}
#media (max-aspect-ratio: 2/3) {
.containerMedia {
columns: 2 auto;
}
.individualBoxMedia{
height: 25vh;
}
}
#media (min-aspect-ratio: 2/3) and (max-aspect-ratio: 3/2) {
.containerMedia {
columns: 3 auto;
}
.individualBoxMedia{
height: calc(100vh/3);
}
}
#media (min-aspect-ratio: 3/2) {
.containerMedia {
columns: 4 auto;
}
.individualBoxMedia{
height: 50vh;
}
}
.individualBox {
border-style: solid;
border-width: 0em;
box-sizing: border-box;
padding: 1vw;
background-color: lightgray;
}
.card{
box-sizing: border-box;
height: 100%;
width: 100%;
padding: 0.5vw;
background-color: white;
border-radius: 0.5em;
}
.cardImageBox{
box-sizing: border-box;
height: 60%;
width: 100%;
}
.cardTextBox {
box-sizing: border-box;
min-height: 0;
min-height: 40%;
max-height: 40%;
width: 100%;
overflow: hidden;
}
.container {
column-gap: 0rem;
max-height: 100vh;
max-width: 100vw;
}
.individualBox img {
width: 100%;
height: 100%;
object-fit: cover;
object-position:top;
border-radius: 0.5em 0.5em 0px 0px;
}
.individualBox p {
padding: 0;
margin: 0;
overflow: hidden;
}
data
//Card Data
export default [
{
text: 'The final Computer Space design uses no microprocessor; the entire computer system is a state machine made of 7400-series integrated circuits, with monochrome graphic elements held in diode arrays.',
location: './images/object1.jpg',
},
{
text: 'object2 rtxyculvy fvgbhjn fcvgbhjn vybhnj ytbjhk xdcfvgbjh ctryvb crtfyvgbh',
location: './images/object2.jpg',
},
{
text: 'object3 cytvub tcvb tcfvyg trcvyb trcyvub yvtub yvtuby vytub vtuyb vtgubh vuybi',
location: './images/object3.jpg',
},
{
text: 'object4 tdrfygu ctryvbuu rtcyvbuni rtyvbu ed5rftyguhijo rextcvyb rtcyguhi rftyguhi',
location: './images/object4.jpg',
},
{
text: 'object5 cvgb ytvubiu rytui rytguhi rtfyguhijo rtfyguhijo zwxretcfyvguhio drftyg',
location: './images/object5.jpg',
},
{
text: 'object6 yvubyhinj ctryvuy rctyvub yrctvubiu rctyfugi f7tygiu rctvyubiu rftyguih',
location: './images/object6.jpg',
},
{
text: 'object7 cfvgbjhkn cfvygtbyhn rxectfvygbuni rtcvybun rctyvbuin rtyvub etcrvytgbu',
location: './images/object7.jpg',
},
{
text: 'object8 cvbyn rcytvubu trcyvubu rfytgui ytugi yrtvubi ytvubi yrctui ytui rfytugih',
location: './images/object8.jpg',
}
];
I would suggest using something like this
.parent {
display: grid;
grid-template-columns: (auto, minmax(250px, 300px))
}
I'm creating a grid system in wordpress using Skeleton.css
The tutorial shows the following markup for the header, here you can see the logo has has a 3 classes, - five columns and clearfix
<header>
<div class="five columns clearfix">
get_template_directory_uri(); ?>/img/logo.svg"></a>
</div>
</header>
But when I look at the skellton css I cannot see a class of 'five' So i changed it to .five.columns But his make no difference, I i create a border around the class .five.columns, it does not show up am I missing something obvious?
.one.column,
.one.columns { width: 4.66666666667%; }
.two.columns { width: 13.3333333333%; }
.three.columns { width: 22%; }
.four.columns { width: 30.6666666667%; }
.five.columns { width: 39.3333333333%; }
.six.columns { width: 48%; }
.seven.columns { width: 56.6666666667%; }
.eight.columns { width: 65.3333333333%; }
.nine.columns { width: 74.0%; }
.ten.columns { width: 82.6666666667%; }
.eleven.columns { width: 91.3333333333%; }
.twelve.columns { width: 100%; margin-left: 0; }
.one-third.column { width: 30.6666666667%; }
.two-thirds.column { width: 65.3333333333%; }
.one-half.column { width: 48%; }
/* Offsets */
.offset-by-one.column,
.offset-by-one.columns { margin-left: 8.66666666667%; }
.offset-by-two.column,
.offset-by-two.columns { margin-left: 17.3333333333%; }
.offset-by-three.column,
.offset-by-three.columns { margin-left: 26%; }
.offset-by-four.column,
.offset-by-four.columns { margin-left: 34.6666666667%; }
.offset-by-five.column,
.offset-by-five.columns { margin-left: 43.3333333333%; }
.offset-by-six.column,
.offset-by-six.columns { margin-left: 52%; }
.offset-by-seven.column,
.offset-by-seven.columns { margin-left: 60.6666666667%; }
.offset-by-eight.column,
.offset-by-eight.columns { margin-left: 69.3333333333%; }
.offset-by-nine.column,
.offset-by-nine.columns { margin-left: 78.0%; }
.offset-by-ten.column,
.offset-by-ten.columns { margin-left: 86.6666666667%; }
.offset-by-eleven.column,
.offset-by-eleven.columns { margin-left: 95.3333333333%; }
.offset-by-one-third.column,
.offset-by-one-third.columns { margin-left: 34.6666666667%; }
.offset-by-two-thirds.column,
.offset-by-two-thirds.columns { margin-left: 69.3333333333%; }
.offset-by-one-half.column,
.offset-by-one-half.columns { margin-left: 52%; }
}
/* Larger than mobile */
#media (min-width: 400px) {}
Many thanks
Here is a fiddle with some styling for height and color to make it obvious. Is your div 0px height? Check it with your developer tools in the browser - Chrome Developer Tools website.
https://jsfiddle.net/p1w61hmt/.
<header style="height: 100px; background: green;">
<div class="five columns clearfix" style="height: 100%;">
</div>
</header>
.five.columns { width: 39.3333333333%; }
.columns { background: red; }
Its probably some pasting errors but your HTML is not valid and your css looks like an incomplete snippet.
I am very new to tumblr and jQuery Masonry, I have create a test blog.
I have a timeline design, by which posts are aligned in two sides and also I used Masonry to remove the space between the posts.
And I have added responsive behavior to this.
Post and Masonry is working properly with responsive on different window size when the page loads but when i resize the window, its design goes to haywire.
I am not able to identify is it my code's mistake or Masonry's :(
Any help will be really helpful.
It is not working with only (min-width: 768px), (min-width: 1024px) and (min-width: 1824px)
Here is my code:
JS
$(document).ready(function() {
if ($(window).width() <= 679) {
$('#posts_container').masonry('destroy');
}
if ($(window).width() > 680) {
$('#posts_container').masonry({itemSelector: '.shadow', });
}
Arrow_Points();
});
function Arrow_Points() {
//alert("function call");
var s = $('#posts_container').find('.shadow');
$.each(s, function(i, obj) {
var posLeft = $(obj).css("left");
$(obj).addClass('borderclass');
if (posLeft == "0px") {
html = "<span class='rightCorner'></span>";
html += "<div class='rightpostcorner'></div>";
$(obj).prepend(html);
$(this).addClass('margin_hack_left_post');
}
else
{
html = "<span class='leftCorner'></span>";
html += "<div class='leftpostcorner'></div>";
$(obj).prepend(html);
$(this).addClass('margin_hack_right_post');
}
});
}
Media
#media only screen and (max-width: 480px) {
.wrapper {width: 100%;}
.rightCorner, .leftCorner{ display: none; }
.shadow {width: 90%; margin: 40px 5% 10px 5%; }
}
#media only screen and (max-width: 680px) and (min-width: 480px){
.wrapper {width: 100%;}
.rightCorner, .leftCorner{ display: none; }
}
#media only screen and (max-width: 768px) and (min-width: 680px){
.wrapper {width: 100%;}
.rightCorner, .leftCorner{ display: none; }
.shadow {width: 90%; margin: 40px 5% 10px 5%; }
}
#media only screen and (min-width: 768px) and (max-width: 1024px) {
.leftCorner { margin-left:-9%;}
.shadow { width: 45.5%; margin-top: 40px; }
.margin_hack_left_post { margin-left:1.5%%; }
.margin_hack_right_post { margin-left:7.5%; }
}
#media only screen and (min-width: 1025px) and (max-width: 1824px) {
.wrapper {width: 100%; }
.leftCorner {margin-left: -5.5%; }
.shadow { width: 43.7%; margin-top: 40px; }
.margin_hack_left_post { margin-left:4%; }
.margin_hack_right_post { margin-left:8%; }
}
/* LARGE SCREENS */
#media only screen and (min-width: 1824px) {
.wrapper {width: 1200px; margin: 0 auto;}
.shadow { width: 43.7%; margin-top: 40px; }
.margin_hack_left_post { margin-left:4%; }
.margin_hack_right_post { margin-left:8%; }
}
My CSS:
.shadow
{
float: left;
background-color: #ffffff;
min-height: 50px;
text-align: justify;
word-wrap:break-word;
}
.timeline_container
{
width: 16px;
text-align: center;
margin: 0 auto;
cursor:pointer;
display: block;
}
.timeline
{
margin: 0 auto;
background-color: red;
display: block;
float: left;
height: 100%;
left: 49.75%;
position: absolute;
width: 1px;
z-index: -1;
}
.timeline:hover{cursor: pointer;margin: 0 auto;}
.timeline div.plus{width: 14px;height: 14px;position: relative;left: -6px;}
.rightCorner
{
background-image: url("xyz.png");
height: 30px;
margin-left: 99.5%;
margin-top: 8px;
padding: 0;
vertical-align: top;
width: 30px;
z-index: 2;
position: absolute;
}
.leftCorner
{
background-image: url("abc.png");
height: 30px;
width: 30px;
margin-top: 8px;
position: absolute;
z-index:2;
}
.content
{
margin-left: auto;
margin-right: auto;
max-width: none;
min-width: 86%;
position: relative;
z-index: 2;
}
And my tumblr HTML is
{block:Posts}
<article class="shadow">
{block:Date}
<div class="post_info">
<section class="post-controls">
<ul style="padding-left: 0px; float: left; width:80%">
<li style="width: 30%; margin-left: 0px; padding-left: 0px; margin-top: 7px;">
<i class="icon-clock"></i> {DayOfMonthWithZero} {ShortMonth} {ShortYear}
</li>
{block:NoteCount}<li style="width: 30%; margin-left: 0px; padding-left: 0px; margin-top: 7px;">
<i class="icon-heart"></i> {NoteCount}</li>{/block:NoteCount}
</ul>
<ul style="float:right;">
<li class="like_link">{ReblogButton size="20"}</li>
<li class="reblog_link">{LikeButton size="20"}</li>
</ul>
</section>
</div>
{/block:Date}
<div class="post_padding">
{block:Audio}
<div class="audio" id="{PostID}">
<div class="album_art">{block:AlbumArt}<img class="scale-with-grid" src="{AlbumArtURL}" />{/block:AlbumArt}</div>
<div class="audio_player_container">
{block:AudioEmbed}{AudioEmbed}{/block:AudioEmbed}
{block:AudioPlayer}{AudioPlayerWhite}{/block:AudioPlayer}
</div>
<div class="caption">
<ul class="audio_details">
{block:TrackName}<li><span class="audio_bold">Song Title:</span> {TrackName}</li>{/block:TrackName}
{block:Artist}<li><span class="audio_bold">Artist:</span> {Artist}</li>{/block:Artist}
{block:Album}<li><span class="audio_bold">Album:</span> {Album}</li>{/block:Album}
<li><span class="audio_bold">Plays:</span> {PlayCount}</li>
</ul>
{block:Caption}{caption}{/block:Caption}
</div>
</div>
{/block:Audio}
{block:Chat}
{block:Title}<div class="chat_title"><h2>{Title}</h2></div>{/block:Title}
{block:Lines}
<div class="lines"><div class="line {Alt}">{block:Label}<strong>{Label}</strong>{/block:Label} {Line}</div></div>
{/block:Lines}
{/block:Chat}
{block:Link}
<div class="link_title"><a href="{URL}" {Target}>{Name} →</a></div>
<div class="caption">{block:Description}{Description}{/block:Description}</div>
{/block:Link}
{block:Photo}
<div class="photo_post">
<a href="{Permalink}" rel="prettyPhoto">
<img class="scale-with-grid" src="{PhotoURL-HighRes}"/>
</a>
</div>
{block:Caption}<div class="caption">{Caption}</div>{/block:Caption}
{/block:Photo}
{block:Photoset}
<div class="photo-slideshow" data-layout="{PhotosetLayout}">
{block:Photos}
<div class="photo-data">
<div class="photo">
<a href="{Permalink}" rel="prettyPhoto[set]">
<img alt="{PhotoAlt}" src="{PhotoURL-500}" data-highres="{PhotoURL-HighRes}" class="{block:Exif}exif-yes {/block:Exif}{block:Caption}caption-yes{/block:Caption}" {block:Exif}data-camera="{block:Camera}{Camera}{/block:Camera}" data-iso="{block:ISO}{ISO}{/block:ISO}" data-aperture="{block:Aperture}{Aperture}{/block:Aperture}" data-exposure="{block:Exposure}{Exposure}{/block:Exposure}" data-focal="{block:FocalLength}{FocalLength}{/block:FocalLength}"{/block:Exif} {block:Caption}data-caption="{Caption}"{/block:Caption}>
</a>
</div>
<div class="icons">
<a rel="prettyPhoto" class="view" rel="post-{PostID}" href="{PhotoURL-HighRes}"><span class="zoom">Zoom</span></a>
<span class="info">Info</span>
</div>
</div>
{/block:Photos}
</div><!-- close SLIDESHOW -->
<div class="caption">{block:Caption}{Caption}{/block:Caption}</div>
{/block:Photoset}
{block:Quote}
<div class="quote_title"><h2>"{Quote}"</h2></div>
<div class="caption"><p>{block:Source}- {Source}{/block:Source}</p></div>
{/block:Quote}
{block:Text}
{block:Title}<div class="post_title"><h2>{Title}</h2></div>{/block:Title}
<div class="caption">{Body}</div>
{/block:Text}
{block:Video}
<div class="video_post">
<figure><div class="embed">{Video-500}</div></figure>
{block:Caption}<div class="caption">{Caption}</div>{/block:Caption}
</div>
{/block:Video}
</div>
</article>
{/block:Posts}
The Javascript will generate hard-pixels for the left-margin, depending on the width of browser window. Change the hard pixels to 50%.
jQuery:
$(this).css("left", "50%");
I am looking to build a website in custom CSS and without frameworks just to increase my command over CSS. I want my entire site to retain its layout and look no matter what the device. Foundation does it with it's "smallgrid" and bootstrap with ".col-xs-". How do I do that without a framework?
Foundation and Bootstrap both use the same way to provide you flexible grids : they fix every possible column width in percents, and use media queries to switch between mobile/tablet/desktop grids (small, medium and large for Foundation, xs, sm, md and lg for Bootstrap).
Have a look on those links to learn more about this :
MDN - Media queries
CSS Wizardry Grid
Profound Grid
Bootstrap 3 Grid System
Foundation 5 Grid
...
Bootstrap 3 :
// Mobile first : Bootstrap display the content with -xs columns
.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6,
.col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11 {
float: left;
}
.col-xs-12 { width: 100%; }
.col-xs-11 { width: 91.66666666666666%; }
.col-xs-10 { width: 83.33333333333334%; }
.col-xs-9 { width: 75%; }
.col-xs-8 { width: 66.66666666666666%; }
.col-xs-7 { width: 58.333333333333336%; }
.col-xs-6 { width: 50%; }
.col-xs-5 { width: 41.66666666666667%; }
.col-xs-4 { width: 33.33333333333333%; }
.col-xs-3 { width: 25%; }
.col-xs-2 { width: 16.666666666666664%; }
.col-xs-1 { width: 8.333333333333332%; }
// if we reach 768px, let's use -sm columns
#media (min-width: 768px) {
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6,
.col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11 {
float: left;
}
.col-sm-12 { width: 100%; }
.col-sm-11 { width: 91.66666666666666%; }
...
}
// ... etc with -md and -lg columns
Foundation 5 :
// Mobile first : Foundation display the content with -small columns
#media only screen {
.column,
.columns {
position: relative;
padding-left: 0.9375rem;
padding-right: 0.9375rem;
float: left; }
.small-1 { width: 8.33333%; }
.small-2 {width: 16.66667%; }
.small-3 { width: 25%; }
.small-4 { width: 33.33333%; }
.small-5 { width: 41.66667%; }
.small-6 { width: 50%; }
.small-7 { width: 58.33333%; }
.small-8 { width: 66.66667%; }
.small-9 { width: 75%; }
.small-10 { width: 83.33333%; }
.small-11 { width: 91.66667%; }
.small-12 { width: 100%; }
}
// If we reach 40.063em, let's use -medium columns
#media only screen and (min-width: 40.063em) {
.column,
.columns {
position: relative;
padding-left: 0.9375rem;
padding-right: 0.9375rem;
float: left; }
.medium-1 { width: 8.33333%; }
.medium-2 {width: 16.66667%; }
...
}
// ...etc with -large columns
You can write your own grid in just a few lines. First decide how many columns you like and that create something like below which is a 4 column grid:
.col-1, .col-2, col-3, .col-4 {
float: left;
/* So that empty columns don't collapse */
min-height: 1px;
padding: 0 16px;
/* Change tje box-model to set columns size in pixels */
webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.col-1 { width: 25%; }
.col-2 { width: 50%; }
.col-3 { width: 75%; }
.col-4 { width: 100%; }
This is mostly what you need. I might want to wrap your columns and to clear the floats using the clearfix trick. If you like, I have a standalone grid system called Fluidable that just just this and a bit more.
This might be a stupid question, but after looking around the world wide webs for a while, I could not find an answer.
I'm using twitter bootstrap's fluid grid system for my new site. I mocked up the homepage's container area to be wider than twitter's default 1170px (1506px).
The 1506px layout breaks down to:
12 columns each 98px (1176px) with 11 margins of 30px (330px)
1176+300 = 1506.
So is there any way that I can just plug this width (1506) into twitter bootstrap without having to overhaul a bunch of LESS and CSS?
Looks like everything you need starts at line 111:
#media (min-width: 1200px) {
...
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 1170px;
}
.span12 {
width: 1170px;
}
...
}
You can NOT use the customizer at http://getbootstrap.com/customize/ unless you drop and replace the 1200px grid.
Compile your own css will be the easiest way:
see: https://stackoverflow.com/a/12029786/1596547 and also Twitter Bootstrap Customization Best Practices
The example below set the min-width of this grid to 1536pixels (1536 x 864) grid width + gutter
fork twitter-bootstrap from github and clone locally
add your new 1536 variables to less/variables.less (before the 1200 variables, see below)
copy less/responsive-1200px-min.less to less/responsive-1536px-min.less "search and replace" 1200 with 1536:
import responsive-1536px-min.less #import "responsive-1536px-min.less"; in less/resposnive.less (before the 1200 include)
Install the LESS command line tool via Node and run the following command:$ lessc ./less/bootstrap.less > bootstrap.css
variables for step 2.:
// 1536px min
#gridColumnWidth1536: 98px;
#gridGutterWidth1536: 30px;
#gridRowWidth1536: (#gridColumns * #gridColumnWidth1536) + (#gridGutterWidth1536 * (#gridColumns - 1));
// 1536px min
#fluidGridColumnWidth1536: percentage(#gridColumnWidth1536/#gridRowWidth1536);
#fluidGridGutterWidth1536: percentage(#gridGutterWidth1536/#gridRowWidth1536);
Or not preferred create your own 1536 (1506) grid css and add it after the bootstrap css in your source.
1536.css:
/* based on Bootstrap v2.3.2 */
#media (min-width: 1536px) {
.row {
margin-left: -30px;
*zoom: 1;
}
.row:before,
.row:after {
display: table;
content: "";
line-height: 0;
}
.row:after {
clear: both;
}
[class*="span"] {
float: left;
min-height: 1px;
margin-left: 30px;
}
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 1506px;
}
.span12 {
width: 1506px;
}
.span11 {
width: 1378px;
}
.span10 {
width: 1250px;
}
.span9 {
width: 1122px;
}
.span8 {
width: 994px;
}
.span7 {
width: 866px;
}
.span6 {
width: 738px;
}
.span5 {
width: 610px;
}
.span4 {
width: 482px;
}
.span3 {
width: 354px;
}
.span2 {
width: 226px;
}
.span1 {
width: 98px;
}
.offset12 {
margin-left: 1566px;
}
.offset11 {
margin-left: 1438px;
}
.offset10 {
margin-left: 1310px;
}
.offset9 {
margin-left: 1182px;
}
.offset8 {
margin-left: 1054px;
}
.offset7 {
margin-left: 926px;
}
.offset6 {
margin-left: 798px;
}
.offset5 {
margin-left: 670px;
}
.offset4 {
margin-left: 542px;
}
.offset3 {
margin-left: 414px;
}
.offset2 {
margin-left: 286px;
}
.offset1 {
margin-left: 158px;
}
.row-fluid {
width: 100%;
*zoom: 1;
}
.row-fluid:before,
.row-fluid:after {
display: table;
content: "";
line-height: 0;
}
.row-fluid:after {
clear: both;
}
.row-fluid [class*="span"] {
display: block;
width: 100%;
min-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
float: left;
margin-left: 1.9920318725099602%;
*margin-left: 1.9388403831482581%;
}
.row-fluid [class*="span"]:first-child {
margin-left: 0;
}
.row-fluid .controls-row [class*="span"] + [class*="span"] {
margin-left: 1.9920318725099602%;
}
.row-fluid .span12 {
width: 100%;
*width: 99.94680851063829%;
}
.row-fluid .span11 {
width: 91.50066401062416%;
*width: 91.44747252126245%;
}
.row-fluid .span10 {
width: 83.00132802124833%;
*width: 82.94813653188662%;
}
.row-fluid .span9 {
width: 74.5019920318725%;
*width: 74.4488005425108%;
}
.row-fluid .span8 {
width: 66.00265604249668%;
*width: 65.94946455313497%;
}
.row-fluid .span7 {
width: 57.503320053120845%;
*width: 57.450128563759144%;
}
.row-fluid .span6 {
width: 49.00398406374502%;
*width: 48.95079257438332%;
}
.row-fluid .span5 {
width: 40.504648074369186%;
*width: 40.451456585007485%;
}
.row-fluid .span4 {
width: 32.005312084993356%;
*width: 31.952120595631655%;
}
.row-fluid .span3 {
width: 23.50597609561753%;
*width: 23.45278460625583%;
}
.row-fluid .span2 {
width: 15.006640106241699%;
*width: 14.953448616879998%;
}
.row-fluid .span1 {
width: 6.507304116865869%;
*width: 6.454112627504167%;
}
.row-fluid .offset12 {
margin-left: 103.98406374501992%;
*margin-left: 103.8776807662965%;
}
.row-fluid .offset12:first-child {
margin-left: 101.99203187250995%;
*margin-left: 101.88564889378654%;
}
.row-fluid .offset11 {
margin-left: 95.48472775564409%;
*margin-left: 95.37834477692067%;
}
.row-fluid .offset11:first-child {
margin-left: 93.49269588313412%;
*margin-left: 93.3863129044107%;
}
.row-fluid .offset10 {
margin-left: 86.98539176626825%;
*margin-left: 86.87900878754483%;
}
.row-fluid .offset10:first-child {
margin-left: 84.99335989375828%;
*margin-left: 84.88697691503486%;
}
.row-fluid .offset9 {
margin-left: 78.48605577689243%;
*margin-left: 78.37967279816901%;
}
.row-fluid .offset9:first-child {
margin-left: 76.49402390438246%;
*margin-left: 76.38764092565904%;
}
.row-fluid .offset8 {
margin-left: 69.9867197875166%;
*margin-left: 69.88033680879319%;
}
.row-fluid .offset8:first-child {
margin-left: 67.99468791500664%;
*margin-left: 67.88830493628322%;
}
.row-fluid .offset7 {
margin-left: 61.48738379814077%;
*margin-left: 61.38100081941736%;
}
.row-fluid .offset7:first-child {
margin-left: 59.49535192563081%;
*margin-left: 59.388968946907404%;
}
.row-fluid .offset6 {
margin-left: 52.98804780876495%;
*margin-left: 52.88166483004154%;
}
.row-fluid .offset6:first-child {
margin-left: 50.996015936254985%;
*margin-left: 50.88963295753158%;
}
.row-fluid .offset5 {
margin-left: 44.48871181938911%;
*margin-left: 44.3823288406657%;
}
.row-fluid .offset5:first-child {
margin-left: 42.49667994687915%;
*margin-left: 42.390296968155745%;
}
.row-fluid .offset4 {
margin-left: 35.98937583001327%;
*margin-left: 35.88299285128988%;
}
.row-fluid .offset4:first-child {
margin-left: 33.99734395750332%;
*margin-left: 33.890960978779916%;
}
.row-fluid .offset3 {
margin-left: 27.49003984063745%;
*margin-left: 27.383656861914048%;
}
.row-fluid .offset3:first-child {
margin-left: 25.49800796812749%;
*margin-left: 25.391624989404086%;
}
.row-fluid .offset2 {
margin-left: 18.99070385126162%;
*margin-left: 18.88432087253822%;
}
.row-fluid .offset2:first-child {
margin-left: 16.99867197875166%;
*margin-left: 16.892289000028256%;
}
.row-fluid .offset1 {
margin-left: 10.49136786188579%;
*margin-left: 10.384984883162385%;
}
.row-fluid .offset1:first-child {
margin-left: 8.49933598937583%;
*margin-left: 8.392953010652427%;
}
input,
textarea,
.uneditable-input {
margin-left: 0;
}
.controls-row [class*="span"] + [class*="span"] {
margin-left: 30px;
}
input.span12,
textarea.span12,
.uneditable-input.span12 {
width: 1492px;
}
input.span11,
textarea.span11,
.uneditable-input.span11 {
width: 1364px;
}
input.span10,
textarea.span10,
.uneditable-input.span10 {
width: 1236px;
}
input.span9,
textarea.span9,
.uneditable-input.span9 {
width: 1108px;
}
input.span8,
textarea.span8,
.uneditable-input.span8 {
width: 980px;
}
input.span7,
textarea.span7,
.uneditable-input.span7 {
width: 852px;
}
input.span6,
textarea.span6,
.uneditable-input.span6 {
width: 724px;
}
input.span5,
textarea.span5,
.uneditable-input.span5 {
width: 596px;
}
input.span4,
textarea.span4,
.uneditable-input.span4 {
width: 468px;
}
input.span3,
textarea.span3,
.uneditable-input.span3 {
width: 340px;
}
input.span2,
textarea.span2,
.uneditable-input.span2 {
width: 212px;
}
input.span1,
textarea.span1,
.uneditable-input.span1 {
width: 84px;
}
.thumbnails {
margin-left: -30px;
}
.thumbnails > li {
margin-left: 30px;
}
.row-fluid .thumbnails {
margin-left: 0;
}
}
You can plug in your customised values here:
http://twitter.github.io/bootstrap/customize.html