Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap columns for iphone and ipad are the same, how to get another size

I have been developing a bootstrap website and I have found 1 very major flaw, it treats tablet size the same as phone size, the col-xs-x (for 768px and under) applies to iphone and ipad alike.

http://www.think.darkstarmedia.net/

With my design I use 2 columns for desktop and tablet size, once in the phone size I want it to be 1 column but bootstrap has no way to do that

I know I could create 2 copies of the exact same content and use media queries (e.g. display:none, display:block) and swap them out for under 480 pixels, but that seems like it goes against the whole point of using something like bootstrap..

Is there anyway to use bootstrap's columns to accomplish what I want..

e.g.
col-sm-3 for desktop (4 columns) col-xs-6 for tablets (2 columns) col-???-12 for phone (1 columns)

Or please clarify if I am missing the obvious

like image 635
Justin Blayney Avatar asked Aug 21 '15 22:08

Justin Blayney


People also ask

How do I make Bootstrap columns equal width?

In rare cases where the column content forces the width (for example columns that contain fixed width images or non-wrapping text), use min-width:0 to force equal column width regardless of their content.

How we define grid for extra small devices in Bootstrap?

Bootstrap Grid - Small Devices Tip: Small devices are defined as having a screen width from 768 pixels to 991 pixels. For small devices we will use the . col-sm-* classes. Now Bootstrap is going to say "at the small size, look for classes with -sm- in them and use those".

How do I change the grid size in Bootstrap?

Go to the Customize menu on Bootstrap website and choose your preferred size. In Less Variables -> Grid system you can find a form to input your preferred sizes. Then you can easily download the preferred grid. Hope this will help.

How do I split my screen in Bootstrap?

Auto Layout Columns In Bootstrap 4, there is an easy way to create equal width columns for all devices: just remove the number from . col-lg-* and only use the . col-lg class on a specified number of col elements. Bootstrap will recognize how many columns there are, and each column will get the same width.


2 Answers

According to their documentation on the Grid Options you should be using the 'xs' classes for phones, 'sm' for tablets, and 'md' classes for desktop.

like image 199
BSMP Avatar answered Oct 11 '22 03:10

BSMP


The solution was to add more media queries and extra styles

/* Extra Small Devices, Phones */
@media only screen and (max-width : 480px){

.callout-wrap, .vertical_photo {
    margin-top:10px;}   

.banner-left, .banner-right, .content-left-side, .content-right-side{
width:100%;

}

.border_drop_bg {
margin-top:10px;
width:100%;}

.vertical_photo {
display:none;}  


 }
like image 43
Justin Blayney Avatar answered Oct 11 '22 03:10

Justin Blayney