Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Media Queries - CSS only for iPhone landscape

Are the same methods used to write CSS only for iPhone in landscape mode?

like image 360
Dee Avatar asked Sep 03 '11 00:09

Dee


People also ask

Can we use media queries to make a website mobile responsive?

CSS Media Queries allow you to create responsive websites that look good on all screen sizes, from desktop to mobile.

What is @media only screen in CSS?

only: The only keyword prevents older browsers that do not support media queries with media features from applying the specified styles. It has no effect on modern browsers. and: The and keyword combines a media feature with a media type or other media features. They are all optional.

Where should I put media queries in CSS?

Important: Always put your media queries at the end of your CSS file.


1 Answers

Yes, sure. Check: http://www.w3.org/TR/css3-mediaqueries/#orientation

@media all and (orientation:portrait) { … }
@media all and (orientation:landscape) { … }

If you want to target iphone only you have to add the resolution or the dppx density to these MQ.

like image 184
Mattia Astorino Avatar answered Sep 21 '22 15:09

Mattia Astorino