I'm not sure why I am getting an error

My code is as follows:

#header {
background: #252525 !important;
.toplinks {
background-color: #333333;
}
}

I get errors where I have the .toplinks part, saying they need to be separate, but in the website's css this is how it is written. How else can I do this?

Comments

  • in the website's css this is how it is written.

    Not likely. It's invalid syntax, so it wouldn't work for them either. Opening brackets before properties require closing brackets after properties:
    #header {
    background: #252525 !important;
    }
    .toplinks {
    background-color: #333333;
    }
  • Thanks. My issue was that I wasn't putting .toplinks under #header. I had it out of order. I dont really code in css so I didn't know that this mattered
Sign In or Register to comment.