Jump to content

Can i specify a CSS file for specific screen resolution ?!


Shifter
 Share

Recommended Posts

hi guys ;as you know when the screen resolution be wider or narrower the position of elements changes and it's so hard to make one css file that maintain all elements in it's suitable position ...is there any way to pecify a CSS file for every screen resolution ?!i have tried many ways using JS and JQuery but it didn't work ... if it possible a php code will be better ...thanks a lot

Link to comment
Share on other sites

just make a fluid layout, using max/min width to control your container. making a stylesheet for each screen resolution is pretty ridiculous. It would take some hoops to do it with PHP anyway, because to get the screen resolution, you would to get it from Javascript, and at that point PHP has already finished executing, so you would have to go back and do something with sessions and redirect, or AJAX, or something not really worth the effort of instead just being pragmatic with your CSS in the first place.

Link to comment
Share on other sites

is there any way to pecify a CSS file for every screen resolution ?!
Yes, you can use media queries to specify different styles depending on screen size. An example of a CSS media query
max-device-width: 480px

With the rise of many different mobile devices browsing the web there has been a lot of talk of 'responsive web design' in the CSS community of late. Check out this article for more: http://www.alistapart.com/articles/responsive-web-design/

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...