Css悬停不影响底部和右边距

时间:2015-06-26 08:27:49

标签: css hover margin

我有这个css代码

#menu:hover img
{
    margin-bottom:50px;
}

和html

<figure id="menu">

    <img src="demo HTML/CaptionHoverEffects/demo 1/images/1.png"/>
    <figcaption class="content">
        <h3>Settings</h3>
        <span>Jacob Cummings</span>
        <a href="http://dribbble.com/shots/1116685-Settings">Take a look</a>
    </figcaption>


</figure>

在css代码中,当我将margin-bottom更改为margin-leftmargin-right时,它会安全运行,但使用margin-bottom时,它无效。我该如何解决?

1 个答案:

答案 0 :(得分:0)

&#13;
&#13;
#menu:hover img {
  margin-bottom: 50px;
}
&#13;
<figure id="menu">

  <img src="http://placehold.it/350x150" />
  <figcaption class="content">
    <h3>Settings</h3>
    <span>Jacob Cummings</span>
    <a href="http://dribbble.com/shots/1116685-Settings">Take a look</a>
  </figcaption>


</figure>
&#13;
&#13;
&#13;