EdwardMartinIII
Technical User
Okay, I've been diggin' more thoroughly into stylesheets and I ran across these two beasts. As I understand, a contextual selector is denoted by a "." in front of it and can apply to any collection of elements (including n = 1):
.Centered {text-align: center;}
An id selector is denoted by a "#" and can apply to only a single element:
#Centered {text-align: center;}
Now, near as I can tell you can use a contextual selector anywhere you can use an ID selector. If that is so, why bother using ID selectors at all?
Curious,
Edward ![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)
"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
.Centered {text-align: center;}
An id selector is denoted by a "#" and can apply to only a single element:
#Centered {text-align: center;}
Now, near as I can tell you can use a contextual selector anywhere you can use an ID selector. If that is so, why bother using ID selectors at all?
Curious,
![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)
![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)
"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door