Web Analytics Made Easy -
StatCounter External Style Sheet Help - CodingForum

Announcement

Collapse
No announcement yet.

External Style Sheet Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    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

    Comment


    • #3
      No, those modifications did nothing, but thanks for trying.

      Comment


      • #4
        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

        Comment


        • #5
          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.
          Check out the Forum Search. It's the short path to getting great results from this forum.

          Comment


          • #6
            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.

            Comment

            Working...
            X