Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 3 Apply CSS on Mobile View Only

I' am using Bootstrap 3, In the mobile view I would like to apply some CSS to fix up some bugs on mobile view. I have looked to documentations and Google it. I' am can't seem to find any clue on it.

Is it possible?

like image 432
Navneil Naicker Avatar asked Nov 07 '13 03:11

Navneil Naicker


People also ask

How do I change Bootstrap 3 column order on mobile layout?

By using col-lg-push and col-lg-pull we can reorder the columns in large screens and display sidebar on the left and main content on the right.

Does the Bootstrap 3 uses a mobile first strategy?

Bootstrap has become mobile first since Bootstrap 3. It means 'mobile first' styles can be found throughout the entire library instead of them in separate files. You need to add the viewport meta tag to the <head> element, to ensure proper rendering and touch zooming on mobile devices.


2 Answers

Just use the appropriate media queries in your CSS, eg

@media (max-width: 767px) {     /* CSS goes here */ } 

Bootstrap defines the following widths

  • Extra small devices (phones, less than 768px)
  • Small devices (tablets, 768px and up)
  • Medium devices (desktops, 992px and up)
  • Large devices (large desktops, 1200px and up)

See http://css-tricks.com/css-media-queries/ for some more information on media queries.

like image 163
Phil Avatar answered Oct 17 '22 04:10

Phil


There are also responsive utilities, you can add classes to certain elements to either show or hide them at certain viewport sizes.

.hidden-xs or .visible-xs 

http://getbootstrap.com/css/#responsive-utilities

like image 39
unclejam Avatar answered Oct 17 '22 02:10

unclejam