click image to enlarge
Currently the main "sizes" can be categorised as:
- 960px to 1024px (tablet landscape to standard desktop)
- 768px to 959px (tablet portrait to desktop)
- 480px to 767px (mobile landscape to tablet portrait)
- Less than 480px (mobile portrait)
So how do you create a website that is fluid and scales to fit these different sizes?
The secret lies in CSS3 media queries.
Media queries allow you to serve up different CSS styles depending on the current screen size. The great thing about this is that new devices (mobiles and tablets) will be able to use media queries, and old devices will just see the standard desktop web site.
Using media queries
Based on the above sizes we can write our CSS in the following order:
/* all styles for standard desktop here */
@media only screen and (min-width: 768px) and (max-width: 959px) {
/* styles for tablet portrait here */ }
@media only screen and (max-width: 767px) {
/* styles for mobile portrait here */}
@media only screen and (min-width: 480px) and (max-width: 767px) {
/* styles for mobile landscape here */}
And that's all there is too it!
Hiding elements in Mobile views
What if you decide there are some elements you just don't want to show in mobile views? (like flash elements or slideshows).
We can simply use CSS to hide that element in the correct portion of the above code using:
#divname {display: none;}
Scaling images
There are a number of solutions for flexible images so that they scale for the correct device:
- Use the media queries above to load different sized background images into div tags based on the screen size.
- Use width and height attributes to scale images, but this doesn't optimise the size of the image (same image is downloaded)
- Use the overflow property in CSS to crop images
- Javascript solutions that resize your images
If you're interested in mobile web design, check out the following articles about mobile phone website development:

Thanks a lot for ur valuable info on responsive web design and the main thing is that using media queries is very interesting to learn and work on.
ReplyDeleteCheers from web design company
Very informative. thanks for the info. It helps a lot. Very useful for our Web developing site
ReplyDeleteFor the best SEO services in Shropshire, please consider BeVivid. Established for more than 7 years, this SEO Shrewsbury firm has a team of SEO specialists who provide result-oriented Search Engine Optimisation services to business who wish to achieve online success.
ReplyDeleteResponsive Web Design is really a recent term that is certainly accustomed to describe the thought of a web site s layout changing in response for that user's display size and resolution.Outsourcing Companies Bangalore
ReplyDeleteI had been discussing this issue with my older sister the other day, now I will have one particular a lot more argument in my hand when it’ll arrive to confrontation the moment yet again.mobile website design
ReplyDeleteVery informative and helpful. web design in oakland Thank you for providing this information.
ReplyDeleteBoost your web site to the top results of the largest search engines. We provide organic traffic based on specific keywords that you choose. Limited offer promotion, get $25 worth or organic visits using the coupon code KiWI-25-Organics
ReplyDeleteThanks for making me aware of the base concept on RWD and the tools which we can use for implementing. It was really informative and helpful for me to upgrade my knowledge on RWD. I appreciate...
ReplyDeleteWeb Application Development Company India
I will focus on this RWD. Thank you for sharing.
ReplyDeleteweb design philippines