Answer the question
In order to leave comments, you need to log in
Should I load different style files for different screens?
I want to do something like this:
<head>
<link rel="stylesheet" type="text/css" href="https://mysite.com/front/style/default/style.css">
<style>
@import url("https://mysite.com/front/style/default/sp.css") screen AND (min-width: 320px) AND (min-height: 450px);
@import url("https://mysite.com/front/style/default/pc.css") screen AND (min-width: 800px) AND (min-height: 600px);
@import url("https://mysite.com/front/style/default/palm.css") handheld, print;
</style>
</head>
style.css
contains general rules; sp.css
- rules for smartphones; pc.css
- rules for campers. Answer the question
In order to leave comments, you need to log in
If we are talking about the "Adaptive" design - then no, it's not worth it. If we are talking about a separate mobile site (when there are almost no common styles), then yes.
The problem is that the definition of "Smartphone" based on screen dimensions can be extremely inaccurate. There are big smartphones, smartphones can change orientation, smartphones have different modes of operation. The same applies to laptops. How do you tell a small laptop from a phablet or tablet?
There are a lot of device options. And don't forget that in many cases your site may not be displayed in full screen.
import and media are used where there is not enough space for blocks. But why
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question