How to make the site adapted to the screen sizes of the phone and iPad?

I am working on a new site and put the width of the set into my css file. I have a requirement to make the site adaptable and resizable to fit the smaller screens of phones and various tablet devices.

What needs to be set in my CSS styles so that the site adapts better to other screen sizes?

+4
source share
1 answer

You want to use media queries. This is the basis of adaptive design.

@media only screen and (max-device-width: 480px) { /* write smartphone styles here */ } @media only screen and (max-device-width: 768px) { /* tablets in portrait mode */ } @media only screen and (max-device-width: 1024px) { /* tablets in landscape mode and smaller/older monitors */ } 

Take a look here: http://coding.smashingmagazine.com/2010/07/19/how-to-use-css3-media-queries-to-create-a-mobile-version-of-your-website/

+4
source

All Articles