Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
284 views
in Technique[技术] by (71.8m points)

html - Using media queries to target either smartphone OR desktop/laptops without pixel sizes

Today, smartphones have very high pixel densities, and a lot of answer on media queries are answered with screen sizes.

I'm using this:

@media handheld {
    p {
        font-size: 300%;
        max-width: 100%;
        margin: 1em;
    }
}

Which only applies to smartphone browsers.

How can have a media query that applies only to non-smartphone screens?

I tried

@media not handheld {
    p {
        font-size: 50%;
    }
}

But it doesn't work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...