Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Location
    MA, USA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    External Style Sheet Help

    Hello. This might be an easy question, but I'm new with style scripts. I am trying to get my external style script to work. I have this code in the <HEAD> section of my HTML document:

    <LINK REL=StyleSheet HREF="style.css" TYPE="text/css">

    In the same directory as the HTML file, I have a style.css file located there. The CSS file has the following:

    a{text-decoration:none}

    .wrap1{position:relative;}
    .wrap2{position:absolute;}
    #dropmenu0, #dropmenu1, #dropmenu2, #dropmenu3, #dropmenu4, #dropmenu5, #dropmenu6, #dropmenu7{z-index:100;}

    .skin0
    {
    position:absolute;
    width:165px;
    border:2px solid black;
    background-color:menu;
    font-family:Tahoma;
    line-height:20px;
    cursor:default;
    font-size:14px;
    z-index:100;
    visibility:hidden;
    }

    .menuitems
    {
    padding-left:10px;
    padding-right:10px;
    }

    Now when I put that following script into an HTML document using <STLYE> tags and the <-- symbols, it works fine. But when I move it to an external file, it is as if the script is not there. It just can't read it. I've looked at how to use external style scripts, and they all say the same thing but this won't work for me. Any help would be much appreciated.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    344
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I know you said this works in an internal way - but try duplicating all those properties for the serparate DIVs

    instead of:

    #dropmenu0, #dropmenu1, #dropmenu2, #dropmenu3, #dropmenu4, #dropmenu5, #dropmenu6, #dropmenu7{z-index:100;}

    try:

    #dropmenu0 {z-index:100;}
    #dropmenu1 {z-index:100;}
    #dropmenu2 {z-index:100;}
    #dropmenu3 {z-index:100;}
    #dropmenu4 {z-index:100;}
    #dropmenu5 {z-index:100;}
    #dropmenu6 {z-index:100;}
    #dropmenu7 {z-index:100;}

    I'm not sure if that'll change anything, but it's nicer to look at.

    Make sure you're link line is between the <head></head> tags.

    <link rel="stylesheet" HREF="style.css" TYPE="text/css">

    Try that, see if it changes anything...

    ~Quack

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Location
    MA, USA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No, those modifications did nothing, but thanks for trying.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Posts
    344
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I always put my external CSS files in a directory (lib)

    This may be a good idea, I don't know if that'll change anything either - but it's worth a shot.

    A few things to check, make sure in your .css file you DO NOT have the <style></style> tags..

    Other than that, it makes no sence to me why your stuff wouldn't be working.

    Have fun

    ~Quack

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just a thought but in your posted sample you have:

    <LINK REL=StyleSheet HREF="style.css" TYPE="text/css">
    You left out the quote marks which should be around the word "stylesheet" and that may be causing the problem.

  • #6
    New to the CF scene
    Join Date
    Jun 2002
    Location
    MA, USA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It actually turns out that the style sheet was in fact working. I am using Frontpage 2002 and when I select the "preview" option, it was as if it couldn't read it the external style sheet, which is wierd because it can access my external javascripts just fine. Accessing the file using IE6, it worked fine. And Roy, I did leave the quotes off, thanks for pointing that out.


  •  

    Posting Permissions

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