Shinker
Shinker

Reputation: 21

Can't get @media queries to work with bootstrap

I just can't seem to get @media queries to work in bootstrap. Take this one for example:

@media only screen and (min-width: 992px) {
.buttonspace {
margin-left:20px;
}
}

The margin shows up but it also shows on devices <992px wide. What am I doing wrong?!

Thanks guys

Upvotes: 0

Views: 94

Answers (1)

ppajer
ppajer

Reputation: 3145

The code you pasted seems to be fine, so I assume this must be a classic example of forgetting to set the viewport. You need to include <meta name="viewport" content="width=device-width,initial-scale=1"> in order for CSS media queries to be understood correctly by the browser.

(This could have been a comment, but alas I have no rep for that.)

Upvotes: 1

Related Questions