Mastering Bootstrap 3: A Comprehensive Guide to Media Queries

Ruth Jul 09, 2026

Bootstrap 3, a popular front-end framework, introduced a robust system of media queries to help developers create responsive designs. Media queries in Bootstrap 3 allow you to apply styles based on the device's viewport dimensions, ensuring your website adapts to different screen sizes and resolutions. Let's delve into the world of Bootstrap 3 media queries, exploring their syntax, usage, and some practical examples.

Bootstrap Media Queries and How to use it?
Bootstrap Media Queries and How to use it?

Before we dive into the specifics, it's crucial to understand that Bootstrap 3 uses a mobile-first approach. This means that styles are initially applied for mobile devices, and then overridden or extended for larger screens using media queries.

Bootstrap 5.3 (2025) Cheat Sheet
Bootstrap 5.3 (2025) Cheat Sheet

Understanding Bootstrap 3 Media Query Syntax

Bootstrap 3 media queries follow the W3C CSS Media Queries specification. They consist of a media type and one or more expressions that check for the condition(s) to apply a specific style. The basic syntax is as follows:

the words bootstrap 3 are written in white on a purple background with vertical stripes
the words bootstrap 3 are written in white on a purple background with vertical stripes

@media not|only mediatype and (expression) { ... }

In Bootstrap 3, the media type is usually 'screen', and the expression is a combination of media features like 'min-width', 'max-width', etc. For instance, the following media query applies styles for screens with a minimum width of 768px:

a screenshot of a computer screen with the text,'how do i use this?
a screenshot of a computer screen with the text,'how do i use this?

@media (min-width: 768px) { ... }

Responsive Utilities in Bootstrap 3

Bootstrap 3 provides responsive utilities that wrap media queries, making it easy to create responsive layouts. These utilities are prefixed with 'visible-', 'hidden-', or 'visible-sm-block', 'visible-md-inline', etc. For example:

Difference Between Bootstrap and CSS
Difference Between Bootstrap and CSS

.visible-sm-block { display: block; }

This utility makes an element display as a block only on screens with a minimum width of 768px (small desktops and larger).

Custom Media Queries

Bootstrap 5 Classes List Cheat Sheet
Bootstrap 5 Classes List Cheat Sheet

While Bootstrap 3 provides many responsive utilities, you might need to create custom media queries for specific breakpoints or conditions. To do this, you can use the following syntax:

@media (min-width: 1200px) { ... }

Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Using Media Queries For Responsive Design In 2018 — Smashing Magazine
Using Media Queries For Responsive Design In 2018 — Smashing Magazine
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
HOT GADGETS e-commerce web page
HOT GADGETS e-commerce web page
NeuBoard Responsive Admin Template Bootstrap + AngularJS
NeuBoard Responsive Admin Template Bootstrap + AngularJS
Webstrot Admin Panel Responsive Bootstrap Dashboard Template
Webstrot Admin Panel Responsive Bootstrap Dashboard Template
Bootstrap Tutorial – Introduction
Bootstrap Tutorial – Introduction
Bootstrap 5 Website Layout Design
Bootstrap 5 Website Layout Design
Thinking in Bootstrap 4, theming with Vartheme BS4 Cheat Sheet
Thinking in Bootstrap 4, theming with Vartheme BS4 Cheat Sheet
How To Center a div Horizontally in Bootstrap 4
How To Center a div Horizontally in Bootstrap 4
Bootstrap 3 grid system explained
Bootstrap 3 grid system explained
Shoelace – Visual Bootstrap 3 Grid Builder
Shoelace – Visual Bootstrap 3 Grid Builder
Bootstrap 4 Classes List Cheat Sheet
Bootstrap 4 Classes List Cheat Sheet
29 Must-Have Cheat Sheets for Web Designers
29 Must-Have Cheat Sheets for Web Designers
LaunchPad - Responsive Admin
LaunchPad - Responsive Admin
Bootstrap 5 Classes List Cheat Sheet
Bootstrap 5 Classes List Cheat Sheet
an image of a dashboard screen with different colors and numbers on it, as well as the
an image of a dashboard screen with different colors and numbers on it, as well as the

In this example, the styles inside the curly braces will be applied to screens with a minimum width of 1200px.

Using Media Queries to Create Responsive Layouts

Media queries are essential for creating responsive layouts in Bootstrap 3. They allow you to change the layout, hide or show elements, and modify styles based on the screen size. Here's a simple example of using media queries to create a responsive navigation menu:

@media (max-width: 767px) { .navbar { display: none; } }

In this case, the navigation menu is hidden on screens with a width of 767px or less. You can then use JavaScript or jQuery to create a toggleable mobile menu.

Responsive Images

Media queries can also be used to serve different image sources based on the screen size. This helps to optimize image load times and improve performance. Here's an example using the 'srcset' attribute:

In this example, the browser will choose the appropriate image source based on the screen width.

Responsive Embeds

Bootstrap 3 also provides responsive embed utilities for videos and iframes. By default, these embeds are centered and responsive. However, you can use media queries to change their behavior or appearance on different screen sizes.

Remember, the key to effective responsive design is to test your website on various devices and screen sizes. This ensures that your media queries are working as expected and providing the best user experience.

In the ever-evolving landscape of web design, understanding and mastering Bootstrap 3 media queries is a vital skill. It empowers you to create flexible, responsive websites that adapt to the diverse range of devices and screen sizes used by your audience today. So, keep practicing, keep learning, and happy coding!