Select parent #example0::parent { background: #E7E7DD; } Select parent and then find child element #example1 a:hover::parent .active{ background: #E7E7DD; } link This one is active link Selected #example2:selected::parent { background: #E7E7DD; } #example3:selected::parent { border: 1px solid #D7D7CD; } #example4:selected::parent { border-width: 2px; border-color: #a00; } Change bg color » Add b