Скрытие div на мобильном телефоне не работает ⇐ CSS

Разбираемся в CSS
Anonymous
Скрытие div на мобильном телефоне не работает

Сообщение Anonymous »


Я пытаюсь создать класс, который можно использовать, чтобы скрыть определенные элементы div в мобильной версии сайта. CSS, который я использую:

Код: Выделить всё

@media screen and (max-width: 720px) {
.desktop-only {
display: none !important;
}
}
The viewport is set to: Yet when I view the site on a device with a resolution less than 720px the div is still visible. I can't seem to figure out why it is not working. What am I missing?
I have tried all of the suggestions listed in Hide div on mobile devices, using CSS but can't seem to figure out what I've done wrong.
Here is a pen to illustrate the issue....resize it to under 720px and the desktop-only div doesn't hide http://codepen.io/anon/pen/vEjvbM


Источник: https://stackoverflow.com/questions/287 ... ot-working

Вернуться в «CSS»