css锚图像高度问题

时间:2013-05-02 01:36:47

标签: css image height anchor

小提琴应该解释这个问题,但是看不出我在这里做错了什么

这是代码:

body {
    background-color: #ededed;
}
#social{
    position: fixed;
    top: 50px;  
    left: 50px;

    border: thin solid #ff6600;
}
#social .facebook a {
    width: 60px;
    height: 60px !important;
    background-color: #000000;

    border: thin solid #00ff00;
} 
#social .facebook a:hover {
    width: 60px;
    height: 60px !important;
    background-color: #3B5998; 
}
<style>
</head>
<body>
<div id="social">
<div class="facebook">
    <a href="#">
    <img src="http://poststudio.co.uk/louisbrennan/facebook.png" 
    width="60" height="60"/>
    </a>  
</div>

</div>    
</body>

http://jsfiddle.net/misemefein/McmAQ/

赞赏的任何想法

1 个答案:

答案 0 :(得分:2)

display: block;添加到#social .facebook a,使其占据其容器的整个高度

示例:http://jsfiddle.net/Adrift/McmAQ/4/

相关问题