# Knowledge check: CSS selectors

1. **While specifying the ideal logical order of the four link-states added as rules in CSS code, what pseudo-class will you add second?**
    
    * Hover
        
    * Active
        
    * Link
        
    * <mark>Visited</mark>
        
2. **For a given** `<div>` **tag and** `<p>` **tag, which of the following will be the correct syntax for use of adjacent sibling combinator?**
    
    * div &gt; p
        
    * <mark>div + p</mark>
        
    * div ~ p
        
    * div p
        
3. **Calculate the specificity of the following selector:**
    
    ```css
    ul#alpha li.visited
    ```
    
    * 22
        
    * 13
        
    * 103
        
    * <mark>112</mark>
        
4. `nth-last-of-type` **is a pseudo element that matches the last sibling from a list of siblings of specific type inside a parent.**
    
    * <mark>TRUE</mark>
        
    * FALSE
        
5. **For the given HTML code, irrespective of the effect on other list elements, which of the following will be a valid selector to ensure “Little” is coloured “red”? Select all that apply.**
    
    ```xml
    <body>
       <ul>
          <li class="red">Little</li>
          <li>Lemon</li>
          <li>Restaurant</li>
       </ul>
    </body>
    ```
    
    * <mark>.red{ color: red; }</mark>
        
    * li { color: red; }
        
    * li &gt; red { color: red; }
        
    * #red { color: red; }
        
    * <mark>ul &gt; .red{ color: red; }</mark>
        
6. **Which of the selectors below will select** `<div>` **tags with a title attribute in CSS?**
    
    * div.title
        
    * #title
        
    * div#title
        
    * <mark>div[title]</mark>
