2015-03-17 3 views
0

Я хотел бы проигнорировать один CSS с моего сайта на смартфоне.Игнорировать CSS на каждом смартфоне

Вот мой CSS, что я хотел бы игнорировать:

a[href="http://localhost/wordpress/ireland/"], a[href="http://localhost/wordpress/france/"], a[href="http://localhost/wordpress/spain/"], a[href="http://localhost/wordpress/portugal/"], a[href="http://localhost/wordpress/canary-islands/"], a[href="http://localhost/wordpress/africa/"], a[href="http://localhost/wordpress/central-america/"], a[href="http://localhost/wordpress/indonesia/"], a[href="http://localhost/wordpress/carribean/"]{ 
    pointer-events: none; 
    cursor: default; 
} 

Может быть, я должен использовать это:

@media only screen and (min-device-width : 320px) and (max-device-width : 480px) { 
/* Styles */ 
} 

Я не очень понимаю, спасибо за вашу помощь!

EDIT:

@media (min-width: 600px){ 
    a[href="http://localhost/wordpress/ireland/"], a[href="http://localhost/wordpress/france/"], a[href="http://localhost/wordpress/spain/"], a[href="http://localhost/wordpress/portugal/"], a[href="http://localhost/wordpress/canary-islands/"], a[href="http://localhost/wordpress/africa/"], a[href="http://localhost/wordpress/central-america/"], a[href="http://localhost/wordpress/indonesia/"], a[href="http://localhost/wordpress/carribean/"]{ 
     pointer-events: auto; 
     cursor: default; 
     } 
    } 

ответ

0

Вы почти есть.

Вам просто нужно обернуть css в media query.

Не знаете, какую ширину вам нужно ограничить, но я думаю, что большинство смартфонов меньше 600 пикселей, поэтому следующее должно работать на вас.

@media (min-width: 600px){ 
    a[href="http://localhost/wordpress/ireland/"], a[href="http://localhost/wordpress/france/"], a[href="http://localhost/wordpress/spain/"], a[href="http://localhost/wordpress/portugal/"], a[href="http://localhost/wordpress/canary-islands/"], a[href="http://localhost/wordpress/africa/"], a[href="http://localhost/wordpress/central-america/"], a[href="http://localhost/wordpress/indonesia/"], a[href="http://localhost/wordpress/carribean/"]{ 
     pointer-events: none; 
     cursor: default; 
    } 
} 
+0

Это не работает, я использую iPhone 5 в портрете. Мой код: отредактирован. Даже если я попытаюсь использовать статью {background-color: red} – Viny76

+0

Я думаю, что есть несколько медиа-запросов для портретов и пейзажей. Не привык к ним, но я помню, что были некоторые – Cheshire

+0

@Cheshire Возможно, это потому, что я использую Wordpress для своего сайта? Я не знаю, CSS не применим к медиа-запросам, которые вы мне говорите:/ – Viny76