Я пытаюсь скрыть кусок элемента div на настольной версии веб-сайта и отобразить его на мобильном телефоне. Однако использование медиа-запросов не позволяет мне. Вы знаете, что может вызвать проблему? Ниже мой код:Отзывчивый дизайн и скрытие элемента div
@media all and(min-device-width: 768px){
.Products{display:block;}
.Products-Mobile{display:none;}
.Benefits{ display:block;}
}
@media all and(min-device-width: 321px) and (max-device-width: 767px){
.Products{display:block;}
.Products-Mobile{display:none;}
.Benefits{ display:block;}
}
@media all and(max-device-width: 320px){
.Products{display:none;}
.Products-Mobile{display:block;}
.Benefits{ display:block;}
}
И мой HTML:
<!-- This class will be displayed on the desktop version of the site and will be hidden on the mobile -->
<div class="Products">
Desktop test
</div>
<!-- This class will be displayed on the desktop version of the site and will be hidden on the mobile -->
<div class="Products-Mobile">this is mobile test</div>
<!-- This class will be displayed on the mobile and the desktop version of the site -->
<div cass="Benefits">
content
</div>
ли вы указать основной CSS выше или ниже запросов СМИ? Проверьте консоль, если ваши медиа-запросы вступают в силу и/или переопределены. – Justinas