title: How to use CSS to position div popup when using :hover...?
body: <p>I am trying to create a popup in CSS. In this case, it's a small div containing text labeling the image you're hovering. However, I am definitely doing it wrong. I am either positioning the :hover div in CSS incorrectly (I've tried different positions (fixed, absolute, float, clear, etc.), but it keeps showing up inside the main div. I could wrong with my HTML, as I'm placing it within the main div that you hover for the popup to appear. But I'd think it has to be there to show up when you hover the main div. Any help is appreciated. Code below:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="topIcons topIconsHover topLabelHover"&gt;
      &lt;a href="image.html"&gt;&lt;img src="icons/image.png" /&gt;&lt;/a&gt; 
      &lt;div class="topLabelHover"&gt;Image&lt;/div&gt;  
  &lt;/div&gt;  
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>.topIcons {
      padding:14px 6px 10px 6px;
      float:right;
   }
  
  .topIconsHover:hover {
      background-color:#555555;
      cursor:pointer
  }
  
  .topLabelHover:hover {
      background-color:#555555;       
      width:80px;
      height:24px;
      position:fixed;
          top:40px;
  }
  </code></pre>
  
  <p>I am fine with using JavaScript (or JQuery) if it's necessary, but it seems like something simple enough for CSS. Also, is it better to use CSS over JavaScript (or Jquery) when possible because perhaps it's faster? I could be mistaken there, but would be interested to of the best practice.</p>
  
  <p>edit* Still having trouble so thought I'd explain further what I'm trying to do with my page layout and perhaps it'll help. I have a series of icons in a navigation bar, all floated right. Upon hovering, I'd like the background to change (which I've managed in CSS with the "topIconsHover" class) and for a "label" div to appear beneath the related hovered icon div in the navigation bar when hovered.</p>