I'm using Bootstrap 3 to build a responsive layout where I want to adjust a few font sizes according to the screen size. How can I use media queries to make this kind of logic?
相关问题
- How to add a “active” class to a carousel first el
- Should I use CSS3 media queries to deliver differe
- Full Clickable Accordion in Bootstrap
- How to add Bootstrap 4 without Tether?
- Laravel overriding bootstrap template
相关文章
- Make Bootstrap tab Active on the bases of URL link
- Rails: Twitter Bootstrap Buttons when visited get
- Reduce spacing between rows
- How do use bootstrap tooltips with React?
- How to control print font size
- Need to design 8 boxes in two rows
- Trigger a Bootstrap .collapse('toggle') vi
- How to override Bootstrap mixin without modifying
We use the following media queries in our Less files to create the key breakpoints in our grid system.
see also on Bootstrap
Based on bisio's answer and the Bootstrap 3 code, I was able to come up with a more accurate answer for anyone just looking to copy and paste the complete media query set into their stylesheet:
Here are two examples.
Once the viewport becomes 700px wide or less make all h1 tags 20px.
Make all the h1's 20px until the viewport reaches 700px or larger.
Hope this helps :0)
Based on the other users' answers, I wrote these custom mixins for easier usage:
Less input
Example usage
SCSS input
Example usage:
Output
As of Bootstrap v3.3.6 the following media queries are used which corresponds with the documentation that outlines the responsive classes that are available (http://getbootstrap.com/css/#responsive-utilities).
Media queries extracted from the Bootstrap GitHub repository from the following less files:-
https://github.com/twbs/bootstrap/blob/v3.3.6/less/responsive-utilities.less https://github.com/twbs/bootstrap/blob/v3.3.6/less/variables.less
These are the values from Bootstrap3: