This page is part of the CSS3.info CSS selectors test. See more info on CSS3 selectors.

  1. div:last-of-type {
    }
    
    <div>Does this element match?</div>

    The CSS selector should match the marked div element, because it is the only element of this type

  2. div:last-of-type {
    }
    
    <div></div>
    <div>Does this element match?</div>

    The CSS selector should match the marked div element, because it is the last element of this type

  3. div:last-of-type {
    }
    
    <div>Does this element match?</div>
    <blockquote></blockquote>

    The CSS selector should match the marked div element, because it is the last element of this type

  4. div:last-of-type {
    }
    
    <blockquote>
       <div>Does this element match?</div>
    </blockquote>
    <div></div>

    The CSS selector should match the marked div element, because it is the last element of this type in this scope

  5. div:last-of-type {
    }
    
    <div>
       <div>Does this element match?</div>
    </div>

    The CSS selector should match the marked div element, because it is the last element of this type in the current scope

  6. div:last-of-type {
    }
    
    <div>Does this element match?</div>
    <blockquote>
       <div></div>
    </blockquote>

    The CSS selector should match the marked div element, because it is the last element of this type in the current scope

  7. div:last-of-type {
    }
    
    <div>Does this element match?</div>
    <div></div>

    The CSS selector should not match the marked div element, because it is the first element of this type

  8. div:last-of-type {
    }
    
    <div>Does this element match?</div>
    <DIV></DIV>

    The CSS selector should not match the marked div element, because it is the first element of this type

  9. div:last-of-type {
    }
    
    <div id='insertAfter'></div>
    
    var ib = document.getElementById('insertAfter');
    ib.parentElement.appendChild(document.createElement("div"));

    The CSS selector should match the div element that is inserted by the Javascript code.

  10. div:last-of-type {
    }
    
    <div id='insertAfter'></div>
    
    var ib = document.getElementById('insertAfter');
    ib.parentElement.appendChild(document.createElement("div"));

    The original div element should not be a match for the :last-of-type selector.