Reputation: 296
What is the difference between
@media all and (min-width: 500px) {
// some css
}
and
@media (min-width: 500px) {
// some css
}
Quite often I see the first declaration, but is there any benefit of including all
?
Upvotes: 7
Views: 193
Reputation: 10677
There is no benefit. According to MDN:
Unless you use the
not
oronly
operators, the media type is optional and theall
type will be implied.
The all
type is implied, so @media (min-width: 500px)
is interpreted as @media all and (min-width: 500px)
and the two statements are equivalent. The latter is just needlessly specific.
Upvotes: 4