D
Dave Higgins
Hi All,
Q1. I am using multiple stylesheets. When a browser loads a page, does
it download all the stylesheets, or only as-needed? (E.g. a "print"
stylesheet is going to be rarely used, a "handheld" css even less so,
but I would like both to be available.) Does it depend on the method
of linking to the stylesheet?
Here is what I am using:
<style type="text/css" media="screen, projection, tv">@import
"layout3.css";</style>
<link rel="stylesheet" type="text/css" href="print.css" media="print"
/>
<link rel="stylesheet" type="text/css" href="handheld.css"
media="handheld" />
When I test the site on a Web Page Analyzer
http://www.websiteoptimization.com/services/analyze/
it *seems* that with the above code, the print.css is considered
"alternate" and not downloaded, whereas the main layout3.css is
downloaded, and handheld.css is downloaded.
I have tried using the @import rule for all the stylesheets, but then
IE5/WinNT takes the last downloaded stylesheet and applies only that
one, even if it isn't for "screen". This way things seem to work, but
it seems redundant to download a non-used css for every page.
Q2. Are stylesheets cached and not re-downloaded every time a new page
is loaded?
Notes:
My pages are XHTML 1.0 Strict, on a Apache/1.3.22 server.
Not sure if these things makes a difference. They are at
http://www.medphysics.leeds.ac.uk/~dmh/mri/
Thanks for any help.
Dave Higgins
Q1. I am using multiple stylesheets. When a browser loads a page, does
it download all the stylesheets, or only as-needed? (E.g. a "print"
stylesheet is going to be rarely used, a "handheld" css even less so,
but I would like both to be available.) Does it depend on the method
of linking to the stylesheet?
Here is what I am using:
<style type="text/css" media="screen, projection, tv">@import
"layout3.css";</style>
<link rel="stylesheet" type="text/css" href="print.css" media="print"
/>
<link rel="stylesheet" type="text/css" href="handheld.css"
media="handheld" />
When I test the site on a Web Page Analyzer
http://www.websiteoptimization.com/services/analyze/
it *seems* that with the above code, the print.css is considered
"alternate" and not downloaded, whereas the main layout3.css is
downloaded, and handheld.css is downloaded.
I have tried using the @import rule for all the stylesheets, but then
IE5/WinNT takes the last downloaded stylesheet and applies only that
one, even if it isn't for "screen". This way things seem to work, but
it seems redundant to download a non-used css for every page.
Q2. Are stylesheets cached and not re-downloaded every time a new page
is loaded?
Notes:
My pages are XHTML 1.0 Strict, on a Apache/1.3.22 server.
Not sure if these things makes a difference. They are at
http://www.medphysics.leeds.ac.uk/~dmh/mri/
Thanks for any help.
Dave Higgins