【问题标题】:css anchor images height issueCSS锚图像高度问题
【发布时间】:2013-04-26 02:15:27
【问题描述】:

fiddle 应该解释这个问题,但看不到我在这里做错了什么

代码如下:

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/

任何想法表示赞赏

【问题讨论】:

  • 如果你告诉我们你的目标会更容易。

标签: css image height anchor


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-16
    • 1970-01-01
    • 2011-09-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多