Simple CSS not even working for me

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Michael7
    New Member
    • Sep 2007
    • 47

    Simple CSS not even working for me

    Hi everyone,

    I'm new to CSS of course, and have been trying to learn it. However, when I try to pull off something as simple as positioning of text . . . nothing works in my index page. So in frustration I made a test page. Just a but of words to test only the code I'm looking for.

    Still nothing!

    I apologize if this question is a nuisance, but could anyone perhaps at least let me know what I'm doing wrong with this very simple thing? I figure if I can just get a simple thing going, I can move onward with fewer trouble, but I can't even get this part!

    The page giving me trouble is this:
    Test Page (workmenforChri st.org/test.html)

    The CSS file, simple enough, has only this in it:
    Code:
    /*The different styles for the website*/
    
    /*Sidebar positioning/*
    
    .sidebar {
    position:       absolute;
    width:          150px;
    top:            0px;
    left:           0px;
    
    }
    
    a.sidebar {color: #2f4f4f}
    I'm sure it's something simple I'm just not getting . . . but I cannot figure it out for the life of me! I even copied the sidebar positioning code from somewhere else in case I was doing something wrong (just changed the width number, and added "px" to the end of it because I noticed it was missing . . .)!

    I really appreciate the help on this, and apologize if it's a nuisance, thanks in advance for the help!

    ~Michael
  • Bruno43
    New Member
    • Jun 2007
    • 16

    #2
    Originally posted by Michael7
    Hi everyone,

    I'm new to CSS of course, and have been trying to learn it. However, when I try to pull off something as simple as positioning of text . . . nothing works in my index page. So in frustration I made a test page. Just a but of words to test only the code I'm looking for.

    Still nothing!

    I apologize if this question is a nuisance, but could anyone perhaps at least let me know what I'm doing wrong with this very simple thing? I figure if I can just get a simple thing going, I can move onward with fewer trouble, but I can't even get this part!

    The page giving me trouble is this:
    Test Page (workmenforChri st.org/test.html)

    The CSS file, simple enough, has only this in it:
    Code:
    /*The different styles for the website*/
    
    /*Sidebar positioning/*
    
    .sidebar {
    position:       absolute;
    width:          150px;
    top:            0px;
    left:           0px;
    
    }
    
    a.sidebar {color: #2f4f4f}
    I'm sure it's something simple I'm just not getting . . . but I cannot figure it out for the life of me! I even copied the sidebar positioning code from somewhere else in case I was doing something wrong (just changed the width number, and added "px" to the end of it because I noticed it was missing . . .)!

    I really appreciate the help on this, and apologize if it's a nuisance, thanks in advance for the help!

    ~Michael
    Close your Css comment style tag correctly
    /* */
    That will get your css working :)

    Also it is good practice to close your statments properly
    a.sidebar {color: #2f4f4f}
    should be
    a.sidebar {color: #2f4f4f;}

    Add the Semicolon ;)

    Comment

    • Michael7
      New Member
      • Sep 2007
      • 47

      #3
      Ah, I KNEW it had to be something as simple as the comment close! Sheesh!

      Thanks so much for that!

      And thanks for the advice about the semicolon. I always wondered about it, but everywhere I saw, they only put the semicolons on multiple declarations.

      Thanks again for the help!

      Comment

      Working...