Professional Webmasters Community
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How to Link A Separate Style-Sheet Using Media Queries

Go down

How to Link A Separate Style-Sheet Using Media Queries Empty How to Link A Separate Style-Sheet Using Media Queries

Post  royal Tue Jan 31, 2012 11:20 pm

Hi Everybody,
Adding the specific code for devices inline might be a good way to use media queries if you only need to make a few changes, however if your stylesheet contains a lot of overwriting or you want to completely separate the styles shown to desktop browsers and those used for small screen devices, then linking in a different stylesheet will enable you to keep the CSS separate.

To add a separate stylesheet after your main stylesheet and use the cascade to overwrite the rules, use the following :

1
<link rel="stylesheet" type="text/css" media="only screen and (max-device-width: 480px)" href="small-device.css" />
royal
royal
Administrator
Administrator

Posts : 2872
Join date : 2010-06-21
Age : 39
Location : Jaipur

http://www.infradoctor.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum