【问题标题】:Ignore CSS on every smartphone忽略每部智能手机上的 CSS
【发布时间】:2015-03-17 12:18:48
【问题描述】:

我想在智能手机上忽略我网站上的一个 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 */
}

我不是很明白,谢谢你的帮助!

编辑:

@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;
        }
    }

【问题讨论】:

    标签: html css responsive-design stylesheet pointer-events


    【解决方案1】:

    你几乎拥有它。

    您只需将 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;
        }
    }
    

    【讨论】:

    • 不行,我在竖屏使用 iPhone 5。我的代码是:已编辑。即使我尝试使用 article{background-color:red}
    • 我认为有一些关于肖像和风景的媒体查询。不习惯,但我记得有一些
    • @Cheshire 也许是因为我在我的网站上使用了 Wordpress?我不知道,CSS 不适用于您对我说的媒体查询:/
    • Wordpress...我真的不喜欢那种页面...我就是不能。确保在标题中是视口的元数据等等。
    猜你喜欢
    • 2020-01-19
    • 2014-08-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-18
    • 1970-01-01
    • 2022-12-10
    • 1970-01-01
    相关资源
    最近更新 更多