Give help. Get help.

  • # August 1, 2008 at 2:40 pm

    I was wondering why in some cases just the #id is used, but in some other cases tag#id is used. It makes sense to me for classes since you can have multiple classes in a page, but not for ids. It’s probably a beginner’s question, but that’s what I am. :D

    To take it further, sometimes I see things like this:
    body#pagewrap ul#nav a

    Why not start that from the li or ul if needed?

    These things are still kinda confusing for me, but I’m getting there in my CSS journey.


    # August 2, 2008 at 11:14 am

    Ok, that makes total sense. It’s all about the specificity. I think it was just throwing me off sometimes seeing declarations with a bunch of tags, and looking over their whole document they didn’t need to go that far. Maybe they’re being specific for future changes, who knows.

    Thanks for the clarification. :thumbsup:

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.