2015-06-26 40 views
-1

影響我有這樣的CSS代碼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-bottommargin-leftmargin-right,它的安全運行,但與margin-bottom,這不起作用。我該如何解決它?

+1

您的代碼工作。我的意思是保證金底部可以和你的懸停CSS一起工作。 – John

+0

@John:它不適用於保證金底部,你嘗試過嗎?謝謝。 –

+0

你的代碼也爲我工作 – wrick17

回答

0

#menu:hover img { 
 
    margin-bottom: 50px; 
 
}
<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>

+0

你的代碼與我的代碼有什麼區別?它仍然沒有工作。 –

+0

你需要margin-bottom,當你將鼠標懸停在圖像上的時候,你會得到這個設置文本由於margin而移動,那麼你應該決定你到底想要什麼 – priya786