title: Changing background color on nested element using CSS a:hover
body: <p>I am trying to change the background color of both the #box and #internalArrow elements in the following script by using the a:hover {background-color: rgb(189, 64, 132);} construct.</p>
  
  <p>This is what I have;</p>
  
  <pre><code>     &lt;style type="text/css"&gt;  
       #box
       {                  
          background-color: rgb(217, 9, 122);
          height: 50px;
          width: 50px;  
  
          position: absolute;               
          top:50%
  
      }
  
      #box:after {
          content: ' ';
          height: 0;
          position: absolute;
          width: 0;        
  
          border: 20px solid transparent; 
          border-right-color: #ffffff;
  
          top: 50%;
          left: 10%;
          margin-left:-15px;
          margin-top:-20px;
      }      
  
      #internalArrow
      {
          width:0;
          height:0;
          position:absolute;
  
          border: 20px solid transparent; 
          border-right-color: rgb(217, 9, 122);       
  
          top: 50%;
          left: 10%;
          margin-left:-5px;
          margin-top:-20px;      
          z-index:100;            
  
      }
  
      #box:hover + #internalArrow
      {
          background-color:rgb(189, 64, 132);
      }
  
      #wrapper
      {
          height:600px;   
          width:50px;
          background-color:#ffffff;
          opacity:0.9;
      }
  
  &lt;/style&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="wrapper"&gt;
  &lt;div id="box"&gt;        
      &lt;a id="anchor" href=""&gt;&lt;div id="internalArrow"&gt;&lt;/div&gt;&lt;/a&gt;        
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>I used this previous answer <a href="https://stackoverflow.com/questions/6910049/on-a-css-hover-event-can-i-change-another-divs-styling">On a CSS hover event, can I change another div&#39;s styling?</a> but it doesn't work for me. I have tried it in Chrome and Firefox.  Any ideas?
  Thanks.</p>