www.webdeveloper.com
Results 1 to 5 of 5

Thread: external CSS: @import

  1. #1
    Join Date
    Nov 2004
    Location
    Canada
    Posts
    330

    external CSS: @import

    I'm working on my change from HTML 4.01 Transitional to Strict. Notice somewhere that using @import, apparently, rather than what I have now:

    Code:
    <link rel="stylesheet" href="cwstrict.css" type="text/css">
    takes care of difficulties with Netscape 4. So should I change from the illustrated form to @import? If so, how do I make such a statement? I have a feeling I should have found it somewhere easily, but as such a babe in the woods, I'm lost, so I apologize for the question, but ask it anyway <g>.

    Tue, 01 Feb 2005 18:34:57
    My site is my home-and-playground
    http://www.coherentdog.org/
    Carol W

  2. #2
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    Instead of the link you set up for an embedded style sheet then use the @import inside of that. The strategy is to only put "old browser" styles in the linked sheet then @import the "advanced" styles.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

  3. #3
    Join Date
    Feb 2005
    Location
    Almelo (NL)
    Posts
    1
    Hello Carol,

    Here is the statement you asked for :

    <STYLE TYPE="text/css">
    @import url("http://www.yourwebsite.com/screen.css") screen;
    @import url("http://www.yourwebsite.com/print.css") print;
    </STYLE>

    The 'screen' or 'print' definitions are optional.

    'screen' sets styles on a monitor, 'print' sets styles for a
    printed page (usualy for a printer-friendly page).

    Greetz from The Netherlands!
    Jascha.

  4. #4
    Join Date
    Nov 2004
    Location
    Canada
    Posts
    330
    Originally posted by ray326
    Instead of the link you set up for an embedded style sheet then use the @import inside of that. The strategy is to only put "old browser" styles in the linked sheet then @import the "advanced" styles.
    Hw interesting! I'll have to study up on that to discover quite what you mean, Ray, but I begin to get the idea, and now at least have numbers of resources from which to study; so many are mentioned here. My Bookmarks list is getting very, very long, haha!

    Thanks a lot, Ray!

    Tue, 01 Feb 2005 20:22:07
    My site is my home-and-playground
    http://www.coherentdog.org/
    Carol W

  5. #5
    Join Date
    Nov 2004
    Location
    Canada
    Posts
    330
    Originally posted by ChiP_1976
    Hello Carol,

    Here is the statement you asked for :

    <STYLE TYPE="text/css">
    @import url("http://www.yourwebsite.com/screen.css") screen;
    @import url("http://www.yourwebsite.com/print.css") print;
    </STYLE>

    The 'screen' or 'print' definitions are optional.

    'screen' sets styles on a monitor, 'print' sets styles for a
    printed page (usualy for a printer-friendly page).

    Greetz from The Netherlands!
    Jascha.
    ChiP, how nice of you to make your first post here a helpful reply to my request for information! Your explanation is helpful too; thanks a lot! And welcome to the forums. I'm not a programmer at all, so it's hard for me, but have been getting wonderful help here! To which you've now contributed. I'm very grateful. And greetings back to you!

    Tue, 01 Feb 2005 20:24:55
    My site is my home-and-playground
    http://www.coherentdog.org/
    Carol W

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles