dcsimg
www.webdeveloper.com
Results 1 to 10 of 10

Thread: @import method not working NN4.7

  1. #1
    Join Date
    May 2003
    Location
    ireland
    Posts
    66

    @import method not working NN4.7

    someone suggested that i use the @import method to hide a stylesheet from NN4.7 but it doesnt seem to work - can anyone spot my error - thanks

    http://www.oneweekofdays.com/testerf...ter/index.html
    ps i also need to hide the page from opera 5.02 -- any ideas ???

    thanks in advance

  2. #2
    Join Date
    Feb 2003
    Location
    Wales, UK
    Posts
    3,147
    I think the location under your @import should be

    <style type="text/css" media="all"><!--
    @import "masterStyleSheet.css";
    --></style>


    Additionally, I would normally just place this line

    @import "masterStyleSheet.css";

    at the top of the styleSheet.css document.

    Hope this helps. You may also wish to remove the caps in your filenames.

    Dave

  3. #3
    Join Date
    May 2003
    Location
    ireland
    Posts
    66

    tried that

    tried that dave - still no luck - i think i might try using php to dodge the css file for this browser -- btw what is the story with capatalising file names is there something wrong with it ??

  4. #4
    Join Date
    Feb 2003
    Location
    Wales, UK
    Posts
    3,147
    File capitals was just an idea - some older browsers are fussy about that.

    What exactly do you mean when you say it doesn't work? Does Netscape 4 actually read the stylesheet?

  5. #5
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    A bit of style sheet swapping could work

  6. #6
    Join Date
    May 2003
    Location
    ireland
    Posts
    66

    doesnt work

    no it seems to read the style sheet but it doesnt understand the negative margains so the page is centred wrong

  7. #7
    Join Date
    Feb 2003
    Location
    Wales, UK
    Posts
    3,147
    Netscape doesn't understand position:absolute;

    you need to move all of the code relating to position:absolute into your stylesheet hidden by the @import rule, removing it from your normal stylesheet.

  8. #8
    Join Date
    Feb 2003
    Location
    Wales, UK
    Posts
    3,147
    you also need to remove all html tags from your stylesheets.


    In CSS:
    /* This is a comment */

    NOT
    <!--This is a comment-->
    BECAUSE THAT'S A HTML COMMENT!

    Sorry for shouting LOL.

    Also, no <style> tags - in short NO HTML in your style sheet.



    http://www.w3schools.com/css/default.asp is a good tutorial if you wish to brush up on your css. I did notice you've got the correct syntax in your second stylesheet!
    Last edited by DaveSW; 09-16-2003 at 10:58 AM.

  9. #9
    Join Date
    Nov 2002
    Location
    XYZZY - UK
    Posts
    1,760
    The @import must be the first item on an external CSS file.
    Last edited by Robert Wellock; 09-16-2003 at 12:43 PM.

  10. #10
    Join Date
    May 2003
    Location
    ireland
    Posts
    66

    Exclamation ???

    right -- got it -- thanks for your help --- it was actually a stupid mistake -- there was a second sheet on the page which i thought was blank but i must have mixed up the names or something so there was info on there - it was this stuff that was doing the damage -- apologies for involving you in a wild goose chase -- thanks for your help

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