HTML Introduction to HTML and CSS Make It Beautiful With CSS Select and Style Multiple Elements by Class

hello i see that in the CSS there is "ul.skills" and than ".skills"

i think i know what it means but could i hava an explanation ?

1 Answer

Tyler Duke
Tyler Duke
4,343 Points

Hey Joans,

ul is the parent of skills.

To access the skills class in CSS, we are accessing it through its parent (ul).

In other words, often you may have classes with the same name but under different parents. To be more specific in your selectors, and to accurately select the element you want to style, you want to select its parent element (in this case, ul).

Another way to view this is like a cookie jar. You want to retrieve a cookie but the cookie is in the cookie jar. In order to get your cookie, you need to open the cookie jar and get the cookie that's inside. In this case, our .cookie--jar class contains our .cookie class. Or, in this case, the ul element contains the .skills class.


P.S. Always make sure your classes have a period in front of them, and your IDs should have a hashtag (# - a much more unique identifier) in front of them.