簡體   English   中英

圖片不會顯示在頁腳中

[英]Images won't show in footer

我要在頁腳中添加2個社交媒體圖像。 它們在我的圖像地圖中,包括正確的等內容,但似乎無法弄清楚為什么它們不顯示?

嘗試了很多,但確實無法解決問題。與固定在我網站上的頁腳有關嗎? 我真的不知道

碼:

<div id="footer">
    <div id="social">
        <p>test</p>
        <div class="facebook"><a href="" title="Facebook Page"></a></div>
        <div class="twitter"><a href="" title="Twitter"></a></div>
    </div>
    <p>Copyright © 2013 . All rights reserved.</p>
</div>

CSS:

#social {
    text-align: center;
}
.facebook a {
    height: 33px;
    width: 33px;
    background-image: url('images/facebook.png');
    background-repeat: no-repeat;
}
.facebook a:hover {
    background-image: url('images/facebookhover.png');
    background-repeat: no-repeat;
}
.twitter a {
    height: 33px;
    width: 33px;
    background-image: url('images/twitter.png');
    background-repeat: no-repeat;
}
.twitter a:hover {
    background-image: url('images/twitterhover.png');
    background-repeat: no-repeat;
}
/* Footer */
 #footer {
    padding: 5px;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    margin: 0;
    background: #333;
    color: #FFF;
}
#footer p {
    text-align: center;
    margin: 0;
}
#footer a {
    color: #fff;
}

這是jsfiddle上的示例: http : //jsfiddle.net/mwx5q/

.facebook a.twitter a使用display block樣式

請檢查,我已經更新了您的jsFiddle文件,您可以根據您的設計更改css。

http://jsfiddle.net/mwx5q/3/

您的url路徑可能有問題。

也許嘗試../images/twitter.png../images/twitterhover.png

這將備份一個文件夾。 如果CSS位於其自己的文件夾中,則很有用,您必須備份到根目錄,然后進入images

希望這可以幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM