title: CSS trouble with Figure & Figcaption
body: <p>I am trying to display images on my site side by side, when you hover over them a gradient appears as well as some text describing the name of the project. I have been attempting this by using figures and figcaptions but have made a lot of progress but I can't get a few things figured out.</p>
  
  <p>1) How to make the caption only display over the image (right now it displays over the image but there is an empty space where the text would be without the CSS)</p>
  
  <p>2) How to align the images side by side, right now they are not displaying evenly.</p>
  
  <p>3) How to make the caption text appear only on hover</p>
  
  <p>My site is here, figures are at the bottom of the page: <a href="http://example4.inivex.com" rel="nofollow">http://example4.inivex.com</a></p>
  
  <p>Here is my CSS:</p>
  
  <pre><code>.test a {
  position: relative;
  display: inline-block;
  border: 1px solid;
  /*float:left;*/
  width:300px;
  height:240px;
  margin:5px;
  }
  
  .test a:hover:before {
  content: '';
  display: block;
  border: 0px solid;
  background: url(http://example4.inivex.com/wp-content/uploads/2014/02/og.png);
  width: 300px;
  height: 240px;
  position: absolute;
  top: 0;
  right: 0;
  }
  
  figure {
  float:left;
  width:300px;
  height:240px;
  margin:5px;
  }
  
  .test figcaption {
  position: relative;
  top: -30px;
  left: 15px;
  }
  </code></pre>
  
  <p>And here is my HTML on the page:</p>
  
  <pre><code>&lt;h3 style= "text-align: center;"&gt;Our Work&lt;/h3&gt;
  &lt;br&gt;&lt;br&gt;
  
  &lt;figure  class="test"&gt;&lt;a href="http://example4.inivex.com/m"&gt;&lt;img         src="http://example4.inivex.com/wp-content/uploads/2013/12/ptf1.jpg" width="300"     height="240" /&gt;&lt;/a&gt;&lt;figcaption&gt;Test Caption&lt;/figcaption&gt;&lt;/figure&gt;&lt;br&gt;
  
  &lt;figure  class="test"&gt;&lt;a href="http://example4.inivex.com/m"&gt;&lt;img src="http://example4.inivex.com/wp-content/uploads/2013/12/ptf1.jpg" width="300" height="240" /&gt;&lt;/a&gt;&lt;figcaption&gt;Test Caption&lt;/figcaption&gt;&lt;/figure&gt;&lt;br&gt;
  
  &lt;figure  class="test"&gt;&lt;a href="http://example4.inivex.com/m"&gt;&lt;img src="http://example4.inivex.com/wp-content/uploads/2013/12/ptf1.jpg" width="300" height="240" /&gt;&lt;/a&gt;&lt;figcaption&gt;Test Caption&lt;/figcaption&gt;&lt;/figure&gt;&lt;br&gt;
  </code></pre>