Columns won't stack horizontally in a single row - html

The image in the 2nd column keeps stacking below the first column and not on the right side of the page. Ive been staring at this for two hours now. I'm using codepen so I have bootstrap preloaded in the background.
http://codepen.io/OfeyDofey/pen/KaLjeG/
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<h3>George Washington</h3><br>
<h3>Montana State Quarter</h3><br>
<h3>Ohio State Quarter</h3><br>
</div>
<div class="col-md-12">
<img src="http://i.imgur.com/YzO3IvA.jpg" class="QC">
</div>
</div>
</div>
</div>

You need to change col-md-12 to col-md-6.
Bootstrap grid works on 12 columns.

Found two bugs.
Grid system is 12 col wide, currently in your code it is 24 cols wide, use -6 instead of -12.
Add 'display:inline;' property to your 'h3{ }' in order to display them inline.

Related

Bootstrap columns aren't nesting properly

I'm trying to make a simple Advent calendar using Bootstrap ('tis the season).
I'm nesting 7 columns per row for the 7 days of each week.
<div class="container-fluid">
<div class="row title">
<div class="col-xs-12"><p>Advent Calendar</p></div>
</div>
<div class="row weekdays">
<div class="col-xs-1"><p>Mon</p></div>
...
<div class="col-xs-1"><p>Sun</p></div>
</div>
<div class="row dates">
<div class="col-xs-1"><p>30</p></div>
<div class="col-xs-1"><p>1</p></div>
...
<div class="col-xs-1"><p>6</p></div>
</div>
</div>
See this fidlle for result.
Unfortunately, the total size the columns exploit is 7/12, not 12/12: they aren't using the full width of the viewport.
Isn't bootstrap supposed to take care of proportions? How can I make them use 100% of the width?
use this tool for customizing your bootstrap
http://getbootstrap.com/customize/#grid-system
in grid system section you can set 14 for #grid-columns instead of 12, then yor customized bootstrap will be 14 columns and then use col-xs-2 instead of col-xs-1 in your html code for each day, then you have full page width for your calendar.

Bootstrap Grid Offset Quetsion

I'm new to Bootstrap and I came across this issue.
<div class="container row">
<div id="page" class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div id="header"></div>
<div id="article"></div>
<div id="footer"></div>
</div>
<div class="col-lg-2 col-md-1"></div>
In boostrap documentation it shows that I dont have to use the last div.
doc: <div class="row">
<div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div>
</div>
6 + 3 = 9. There are 3 col missing. I just want to make sure I understood this well before progressing into more details.
IF there are col missing inside a row will row automatically add them?
Or will I have some sort of a surprise bug at the long run.
I was using the 1200px grid system before. and I always had to add the the cols in correct order and correct numbers.
6+3= 9 & The remaining columns/grids i.e 3 columns space will remain empty, it won't give any bug, it just center align the DIV having class col-md-offset-3 by moving it 3 columns from left and 3 columns on right are empty so the DIV will be center aligned.
Hope this will bring some clarity, thanks.
First: Don't put class container and row in the same div.
Answer: If you start a new row it will start counting from zero again.
You could put all your sections in separate containers.
<div class='container'><!--this is your container-->
<div class='row'><!--this is your row-->
<div class='col-md-4 col-md-offset-3'><!--populating row with col with offset-->
</div>
</div>
<div class='row'>
<!--some other cols will start counting from zero because it is a new row-->
</div>
</div>

Bootstrap grid system: pull last column right regardless of other columns?

I have the following simplified markup:
<div class="row">
<div class="col-lg-3" ng-if="isSuperUser()">
Conditional column 1
</div>
<div class="col-lg-3">
Column 2
</div>
<div class="col-lg-6">
Column 3
</div>
</div>
I want Column 3 to take up the last 6 grid columns always. I also want the contents of Column 1 or Column 2 if not a super user to take up the first 3 grid columns depending.
The problem is when the Column 1 is not displayed, Column 2 and Column 3 shift to the left such that Column 3 is no longer on the right side. A solution that seems hacky is to add a <div class="col-lg-3" ng-if="!isSuperUser()"> before Column 3, but it seems like there may be a better solution.
I can't see anything in Bootstrap's documentation that demonstrates this functionality. I see there is push and pull classes, but they don't seem to be what I'm looking for.
Thanks in advance.
JSBIN
you can try nest row into the .col-xs-*. That's mean you could use the out row to fixed position before you want hidden something.
<div class="container">
<div class="row">
<div class="col-xs-6">col 6
<div class="row">
<div class="col-xs-2">
2
</div>
<div class="col-xs-10">
10
</div>
</div>
</div>
<div class="col-xs-6">col 6
<div class="row">
<div class="col-xs-12">
your purpose
</div>
</div>
</div>
</div>
</div>
You are looking to offset columns in Bootstrap. Conditionally add the class .col-lg-offset-3 to the second column.

Div nesting issue with Gumby framework grid

Using the Gumby Framework I'm encountering issues nesting divs.
I'm trying to nest a three and seven column grid within a ten column grid.
I've tried a few variations with my HTML/CSS to no avail. Figure I must be missing something fairly simple.
Site Link
HTML code example:
<div class="ten columns main_col">
<p>Text removed</p>
<div class="row">
<div class="three"><h2 class="100width">Core Services</h2></div>
<div class="seven"></div>
</div>
</div>
The framework isn't "smart". Everything is based on 12 or 16 columns. So you've got to do all the thinking for things of this nature. If you want a 3-7 centered container within a 12 column grid, the following code does just that:
<!-- 10 Columns -->
<div class="row">
<div class="three columns push_one">3 col</div>
<div class="seven columns">7 col</div>
</div>
<!-- // End 10 -->
Here's why: 10 columns = 10 of 12(for argument's sake), 3 columns and 7 columns within that container are actually a 30% of 12 column next to a 70% of 12 column residing inside a 83.333% of 12 column container. Throwing class="ten columns" on the container doesn't fire some kind of recursive function to "reset" the container as a 10 column grid system; thus, the goofy margins, padding, etc. It's actually working as expected. Hope that makes sense.

twitter bootstrap fluid grid columns [duplicate]

This question already has answers here:
Changing number of columns dynamically in Bootstrap grids
(2 answers)
Closed 9 years ago.
When using Bootstrap's fluid grid, is it necessary to declare a column when you want the content to span the entire width of the row. In other words, is this sufficient
<div class="row-fluid">
This column should span the full width of the row
</div>
Or is it really necessary to do this (as the docs suggest):
<div class="row-fluid">
<div class="span12">This column should span the full width of the row</div>
</div>
Also, when I want to nest columns in a fluid grid, according to the docs
Nesting with fluid grids is a bit different [to a non-fluid grid]: the number of nested columns should not match the parent's number of columns. Instead, each level of nested columns are reset because each row takes up 100% of the parent column.
The docs then go on to give this example where the first row is one full-width column and the second row has 2 half-width columns
<div class="row-fluid">
<div class="span12">Fluid 12
<div class="row-fluid">
<div class="span6">Fluid 6</div>
<div class="span6">Fluid 6</div>
</div>
</div>
</div>
Apart from the class name of the rows, I don't see how this is at all different to a non-fluid grid. Also, this example seems to contradict the statement
the number of nested columns should not match the parent's number of columns
Because last time I checked 6 + 6 = 12. Can someone improve on this explanation?
(1) I don't see how this is at all different to a non-fluid grid
It uses percentages
(2) the number of nested columns should not match the parent's number of columns
Well, bad example, what they simply mean is that the number in the class names should always add up to 12, regardless of what they are nested in.
This is correct:
<div class="row-fluid">
<div class="span6 row-fluid">
<div class="span4"> </div>
<div class="span4"> </div>
<div class="span4"> </div>
</div>
</div>
instead of this, which is wrong:
<div class="row-fluid">
<div class="span6 row-fluid">
<div class="span2"> </div>
<div class="span2"> </div>
<div class="span2"> </div>
</div>
</div>