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
    'whoever gives to one of these so much as a cold drink of water because he is my disciple -- he will by no means loose his reward in the kingdom of heaven' - matthew 10:42

  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
    In a world without walls and fences - who needs Windows and Gates?! - Unknown Author
    "And there's Bill Gates, the...most...famous...man in the...ah...Microsoft." -- A TV commentator for the 2000 Olympics.


    Web Design Faq? | W3C | Validator | Accessibility testing | Speed up your PC | Wura | Box Model Research

  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 ??
    'whoever gives to one of these so much as a cold drink of water because he is my disciple -- he will by no means loose his reward in the kingdom of heaven' - matthew 10:42

  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?
    In a world without walls and fences - who needs Windows and Gates?! - Unknown Author
    "And there's Bill Gates, the...most...famous...man in the...ah...Microsoft." -- A TV commentator for the 2000 Olympics.


    Web Design Faq? | W3C | Validator | Accessibility testing | Speed up your PC | Wura | Box Model Research

  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
    'whoever gives to one of these so much as a cold drink of water because he is my disciple -- he will by no means loose his reward in the kingdom of heaven' - matthew 10:42

  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.
    In a world without walls and fences - who needs Windows and Gates?! - Unknown Author
    "And there's Bill Gates, the...most...famous...man in the...ah...Microsoft." -- A TV commentator for the 2000 Olympics.


    Web Design Faq? | W3C | Validator | Accessibility testing | Speed up your PC | Wura | Box Model Research

  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 09:58 AM.
    In a world without walls and fences - who needs Windows and Gates?! - Unknown Author
    "And there's Bill Gates, the...most...famous...man in the...ah...Microsoft." -- A TV commentator for the 2000 Olympics.


    Web Design Faq? | W3C | Validator | Accessibility testing | Speed up your PC | Wura | Box Model Research

  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 11:43 AM.

  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
    'whoever gives to one of these so much as a cold drink of water because he is my disciple -- he will by no means loose his reward in the kingdom of heaven' - matthew 10:42

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