Search code examples
cssmobiletwitter-bootstrapmedia-queries

Creating stable, responsive layouts in Twitter Bootstrap


I am building a responsive layout with Twitter Bootstrap and I am finding it difficult to keep the layout looking good across all sizes/devices.

In my early attempts I tried simply using the grid for placement, but page elements never ended up where I wanted them at different sizes. Now I am at the point where I am using media queries to override some of Bootstrap's styles and my own styles. This seems like it may cause a maintenance headaches down the road.

Rather than overriding styles I am thinking that I should add/remove the styles based on the screen's size by registering for media query events.

Can someone offer advice on good practices for adjusting the layout of a page at different screen sizes using Bootstrap?

I am looking for general advice, but I can post code and screenshots if that will help.

Update: Looks like media query events are not well supported.


Solution

  • Your on the right track. Use CSS media Queries. Firefox has a nice add on that enables you to adjust the page to a particular viewport so that you can see the changes pixel by pixel, though Im sure chrome would have something similar

    There are no special tricks just because its bootstrap, as long as you have enabled the responsive stylesheet then you are pretty much good to go

    This is a good place to start for media queries

    http://css-tricks.com/snippets/css/media-queries-for-standard-devices/