Quiz

  1. what is a descendant selector and how are they used?

    Ah, I love these. They allow you to style things based on their context. Here's my favorite example:

    • Normal hyperlinks, you'd like to be blue, but maybe more of a navy blue.
    • You want the navbar to be navy blue, and so
    • hyperlinks within the nav bar you want to be white

    So, you do:

    
        a {
            color: rgb(28,28,132);
        } 
    
        nav {
            background-color: rgb(28,28,132);
        }
    
        nav a {
            color: white;
        }