15 replies [Last post]
Rod
Offline
Regular
Last seen: 17 years 43 weeks ago
Joined: 2004-07-27
Posts: 12
Points: 0

I have made all my css with import ... but I have seen (too late) Mozilla didn't read it ...

Question : is my Mozilla the problem ? And if it's not the case, why Firefox does ? (Gecko browsers no ??!!!)

How many NEW browsers don't accept this ? Sad

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 19 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Question about @import ...

Rod, as far as I'm aware all major browsers work with the @import rule (if indeed this is what you mean or are you refering to linking to externa sheets)
It's versions like NN4 and probably pre IE5 browsers that don't see it but someone may correct me, you may well be having some other problem. If FF works with the rule then Mozilla must as they are at heart the same engine. it may help to give a fuller description and sight of the rules your using.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Amn
Offline
newbie
Last seen: 17 years 47 weeks ago
Joined: 2004-06-28
Posts: 9
Points: 0

Question about @import ...

Make sure all your @import directives PRECEDE anything in the stylesheet file. They HAVE to go before anything else.

Mozilla understands them just fine.

Rod
Offline
Regular
Last seen: 17 years 43 weeks ago
Joined: 2004-07-27
Posts: 12
Points: 0

Question about @import ...

I become crazy, really ...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>

        <link rel="stylesheet" type="text/css" href="css/style.css" media="screen" /> 

        <title>Sortons.Net : sortir à Rouen, Caen et Normandie : bars, pubs, discotheques, concerts, cinema, theatre, agendas, photos ...</title>

I have put link rel everywhere in head ... this is the last position (before title) nothing happens ...

in style.css I have

@import url( style-layout.css );
@import url( style-colors.css );

In Opera 7.x and IE 6.x, all works fine : however in Firefox and Mozilla, the styles are not taken ... but if I put all the content of the styles INSIDE the page, all works well ...

Something seems to prevent of reading import ... and in other way, link rel ...

Amn
Offline
newbie
Last seen: 17 years 47 weeks ago
Joined: 2004-06-28
Posts: 9
Points: 0

Question about @import ...

Send me (or post) your pages as test cases (minimal amount of data where problem persists) at . State the version of Mozilla you use, the OS, and I will be happy to help you.

All common sense tells me you have a very simple mistake somewhere, because I never had this problem, ever, with any import directives at all. So, I will look at it, and try to figure it out.

Cheers !

Rod
Offline
Regular
Last seen: 17 years 43 weeks ago
Joined: 2004-07-27
Posts: 12
Points: 0

Question about @import ...

nobody ? Sad

DanA
DanA's picture
Offline
Elder
Last seen: 12 years 2 weeks ago
Timezone: GMT+2
Joined: 2004-08-14
Posts: 1087
Points: 2

Question about @import ...

What happens if you put
<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
<style type="text/css">
<!--
/*<![CDATA[*/
@import "css/style-layout.css";
@import url(css/style-colors.css);
/*]]>*/
-->
</style>
in the html file

or replace

@import url( style-layout.css );
@import url( style-colors.css );
with
@import url( css/style-layout.css );
@import url( css/style-colors.css );
in your stylesheet

Rod
Offline
Regular
Last seen: 17 years 43 weeks ago
Joined: 2004-07-27
Posts: 12
Points: 0

Question about @import ...

Thanx for your help ... but nothing works again Sad

I become crazy with Mozilla / Firefox ... and all works well in Opera / IE !!!

DanA
DanA's picture
Offline
Elder
Last seen: 12 years 2 weeks ago
Timezone: GMT+2
Joined: 2004-08-14
Posts: 1087
Points: 2

Question about @import ...

Really strange
try

<style type="text/css">
<!--
/*<![CDATA[*/
@import "/css/style-layout.css";
@import url(/css/style-colors.css);
/*]]>*/
-->
</style>
<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
in the html file
and remove the imports from style.css

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 19 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Question about @import ...

This can't still be a problem Shock :? the threads above have covered just about every possible permutation of syntax! the problem must lie elsewhere and dare I say likely to be something simple that's been overlooked. It may help to post your main style sheet with the @import rules in.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Amn
Offline
newbie
Last seen: 17 years 47 weeks ago
Joined: 2004-06-28
Posts: 9
Points: 0

SOLUTION !!!

SOLUTION:

Rod, you are serving css/style.css as a HTML file (mime: text/html). DONT EVER DO THAT!

Mozilla thinks your stylesheet is a HTML file and ignores it. Stylesheets must be text/css

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 19 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Question about @import ...

And how do we arrive at that solution Amn? based on the information supplied there was no mention of pages being served up or a link to them otherwise the problem would probably have been cleared up sooner.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Amn
Offline
newbie
Last seen: 17 years 47 weeks ago
Joined: 2004-06-28
Posts: 9
Points: 0

Question about @import ...

I agree, Hugo.

But i asked Rod previously to email me a testcase, and he PMd me some links to online site. Thats how I figured it out.

I guess it is not nice to omit details if you need help, but I solved it completely accidentally. Besides, how did Rod know he has a problem in totally different place than CSS engine itself ?

Rod
Offline
Regular
Last seen: 17 years 43 weeks ago
Joined: 2004-07-27
Posts: 12
Points: 0

Question about @import ...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>

        <link rel="stylesheet" type="text/css" href="css/style.css" media="screen" /> 

        <title>Sortons.Net : sortir à Rouen, Caen et Normandie : bars, pubs, discotheques, concerts, cinema, theatre, agendas, photos ...</title>

        <meta http-equiv="content-type" content="text/css;charset=iso-8859-1" /> 

Here's the new code : nothing happens Sad

Amn
Offline
newbie
Last seen: 17 years 47 weeks ago
Joined: 2004-06-28
Posts: 9
Points: 0

Question about @import ...

Rod,

Please read my next last post (and last one too for that sake).

Did you miss something ?

DanA
DanA's picture
Offline
Elder
Last seen: 12 years 2 weeks ago
Timezone: GMT+2
Joined: 2004-08-14
Posts: 1087
Points: 2

Question about @import ...

We cannot help you if you do not give the actual code.
You should read the previous posts, use cut and paste into your source, and empty the browser cache before testing.
The solutions listed abobe should all work and Amn, having the code, must be right.

Il faut lire ce qui se trouve dans les messages ci-dessus, vider les caches et utiliser copier/coller pour tester les solutions qui sont proposées et qui devraient convenir.