A
A
Anton Yatsenyuk2014-09-22 15:35:55
css
Anton Yatsenyuk, 2014-09-22 15:35:55

How does @media work?

What is the difference between this declaration:

@media (max-width: 768px) {
    .content {
        width: 500px;
    }
}

and like this:
@media screen and (max-width: 768px) {
    .content {
        width: 500px;
    }
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Petrov, 2014-09-22
@Petroveg

An unspecified type means all :

@media (max-width: 768px) {...}
@media all and (max-width: 768px) {...}

P
Pavel Myshkin, 2014-09-22
@Pazys

The second is only for monitor screens. Will not apply to TVs, projectors, printing, smartphones (ios and android 100% don't care about handled).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question