title: How can I change the background-color of a div inside a link
body: <p>Is it possible to change the background-color of a div inside a link using only a :visited pseudo class and without using Javascript?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
        &lt;style&gt;
              a:hover {background-color:blue;}
              a:visited {background-color:green;}
  
             .smallbox {
              background-color: #666;
              height: 50px;
              width: 50px;
             }
             .smallbox:hover {background-color:blue;}
             .smallbox:visited {background-color:green;}
        &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;a href="#"&gt;&lt;div class="smallbox"&gt;&lt;/div&gt;&lt;/a&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>