473,396 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Media Type / @Import url

I am trying to use the import method of attaching stlyesheets but I'm
getting strange results.

this is the code I'm using...

<head>
<title>CSS Example</title>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" />

<style>
@import url("style/screen2.css") screen;
@import url("style/print.css") print;
</style>

</head>

IE6.0 Does'nt render the styles at all but Opera and Netscape do.

Any ideas???

Thanks

Alun
Jul 20 '05 #1
5 4717
al**@pentangle.co.uk (Alun) wrote:
@import url("style/screen2.css") screen;
@import url("style/print.css") print;

IE6.0 Does'nt render the styles at all but Opera and Netscape do.


UAs are notoriously buggy in their support for CSS media rules,
unsurprisingly IE is again amongst the worst.

What works for me is a combination of linking, importing and media
wrappers inside the css files. I aim to support IE5.5+, Moz and Opera.

Example:
HTML: http://www.pan-europe.utvinternet.ie (also links in a handheld SS)
First SS: http://www.pan-europe.utvinternet.ie/css/one.css
Second SS: http://www.pan-europe.utvinternet.ie/css/two638.css

Note that this method is not spec compliant, a stylesheet that is linked
in without a specified media type is supposed to apply to screen only,
but Opera, Moz and IE all use the print section.

Test extensively in all UAs that *you* want to be compatible with
because of the many bugs.

--
Spartanicus
Jul 20 '05 #2
Alun wrote:
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" />
This should be set in an http header, not inside the document.
<style>
Style element requires a type attribute:

<style type="text/css">
@import url("style/screen2.css") screen;
@import url("style/print.css") print;


Browsers can be very picky about @import statements. There are
different, equally acceptable syntaxes; try it without quotes, without
"url", etc, and see if that helps.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #3
Spartanicus wrote:

Note that this method is not spec compliant, a stylesheet that is linked
in without a specified media type is supposed to apply to screen only,


Where in the spec does it say this? The media reference I found says
quite the opposite:

<URL:http://www.w3.org/TR/CSS2/cascade.html#x5>
"In the absence of any media types, the import is unconditional.
Specifying 'all' for the medium has the same effect."

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 20 '05 #4
kchayka <us****@c-net.us> wrote:
Note that this method is not spec compliant, a stylesheet that is linked
in without a specified media type is supposed to apply to screen only,


Where in the spec does it say this? The media reference I found says
quite the opposite:

<URL:http://www.w3.org/TR/CSS2/cascade.html#x5>
"In the absence of any media types, the import is unconditional.
Specifying 'all' for the medium has the same effect."


http://www.w3.org/TR/html401/present...tml#adef-media
media = media-descriptors [CI]
This attribute specifies the intended destination medium for style
information. It may be a single media descriptor or a comma-separated
list. The default value for this attribute is "screen".

--
Spartanicus
Jul 20 '05 #5
On Mon, 28 Jun 2004 17:37:10 +0100, Spartanicus <me@privacy.net> wrote:
kchayka <us****@c-net.us> wrote:
Note that this method is not spec compliant, a stylesheet that is
linked
in without a specified media type is supposed to apply to screen only,


Where in the spec does it say this? The media reference I found says
quite the opposite:

<URL:http://www.w3.org/TR/CSS2/cascade.html#x5>
"In the absence of any media types, the import is unconditional.
Specifying 'all' for the medium has the same effect."


http://www.w3.org/TR/html401/present...tml#adef-media
media = media-descriptors [CI]
This attribute specifies the intended destination medium for style
information. It may be a single media descriptor or a comma-separated
list. The default value for this attribute is "screen".


In practice, browser don't handle it this way. Style sheets without media
attribute are handled as 'media=all'.

--
Rijk van Geijtenbeek

The Web is a procrastination apparatus:
It can absorb as much time as is required to ensure that you
won't get any real work done. - J.Nielsen
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Richie | last post by:
What I want is to have a link to a file (it could be a .zip, .exe, .jpg, ..txt or even .html) and when the user clicks on it they are prompted with the Save As box, as opposed to it opening in the...
0
by: Henri Sivonen | last post by:
I have written a servlet wrapper and a custom entity resolver for Jing. My code needs to decide whether to instantiate a compact syntax schema reader or an XML syntax schema reader. I would very...
0
by: James Pickering | last post by:
http://www.w3.org/People/mimasa/test/xhtml/media-types/results -- James Pickering http://jp29.org/ XHTML 1.0 Content negotiation version: http://jp29.org/indexbak.php
1
by: Stan Sainte-Rose | last post by:
Hi, I m trying to use the Visual Web Developper 2005 Express Edition Beta and I have a question about the style sheet. I use to use this syntax with my asp code <style type="text/css"...
0
by: Mike | last post by:
Hi I'm looking for a way to select the Media Type (i.e Plain) when printing with the System.Drawing.Printing namespace. It's easy to select bin, but how is the Media Type set from within vb .NET ...
11
by: Mark | last post by:
Hello I made a site with validated XHTML and CSS. It works fine also. Only in IE i see the site build up without CSS (very fast though) and then the CSS is used to build the page. When i use...
0
by: Garmt de Vries-Uiterweerd | last post by:
X-posted to opera.page-authoring, because this is a bit Opera-specific for the moment. F'up to ciwas. I am playing around with dedicated styling for the projection media type.. Currently the...
3
by: Markus | last post by:
Hello While googling for this topic I found lots of advice on how to use @media rules to _hide_ stuff from Mac IE. Anyway, actually _using_ @media to write media specific CSS for both Win and...
1
by: jon | last post by:
Hello, I currently have a html and a css file with a @import rule and a url (see example below) test.html <style type="text/css" media="screen"> <!-- @import url("index_files/p7tp_01t.css");...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.