为什么我的高度标签不起作用?

时间:2014-11-29 22:11:30

标签: css

所以我的下面的代码工作得很好,除了由于某种原因,我的图像上的高度标记没有正常使用。我的图像非常挤压,我无法弄清楚原因。什么标签搞砸了?

我的代码片段:

/*IMAGE HOVER STYLE*/

ul.img-list {
  list-style-type: none;
  margin: 0;
  padding: 0;
  text-align: center;
}
ul.img-list li {
  display: inline-block;
  height: 100px;
  margin: 0 1em 1em 0;
  position: relative;
  width: 100px;
}
span.text-content {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  cursor: pointer;
  display: table;
  height: 100px;
  left: 0;
  position: absolute;
  top: 0;
  width: 100px;
}
span.text-content span {
  display: table-cell;
  text-align: center;
  vertical-align: middle;
}
span.text-content {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  cursor: pointer;
  display: table;
  height: 100px;
  left: 0;
  position: absolute;
  top: 0;
  width: 100px;
  opacity: 0;
}
ul.img-list li:hover span.text-content {
  opacity: 1;
}
span.text-content {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  cursor: pointer;
  display: table;
  height: 100px;
  left: 0;
  position: absolute;
  top: 0;
  width: 100px;
  opacity: 0;
  -webkit-transition: opacity 500ms;
  -moz-transition: opacity 500ms;
  -o-transition: opacity 500ms;
  transition: opacity 500ms;
}
<div align=center>
  <table border="0" style="margin-top: 10px; margin-bottom: 10px; margin-right: 50px; float: right; background-color: #708C91; opacity: 0.7; border:0px solid #708C91;color:#000000;width:700px;" cellpadding="10px" cellspacing="10px">
    <tr>
      <td>
        <center>Site Spotlights</center>
        <hr width=60% style="opacity:.7">
      </td>
    </tr>
    <tr>
      <td>
        <ul class="img-list">
          <li>
            <img src="http://i1371.photobucket.com/albums/ag312/MaxximusOzz/MOTM_zps3aa2f324.png" width="100" height="100" />
            <span class="text-content"><span>Member</span></span>
          </li>
        </ul>
      </td>
    </tr>
  </table>
</div>

1 个答案:

答案 0 :(得分:0)

图片中没有height属性。

heigth="100"

应该是:

height="100"