0
這是我的代碼。 HTML:Img與CSS交換不起作用
<div id="socmed">
<div id="icons">
<div id="fb"></div>
</div>
</div>
CSS:
#socmed {
height: 100px;
padding-top: 70px;
padding-bottom: 50px;
background-color:rgba(247, 34, 34, 0.7);
width: 100%;
}
#icons {
width: 300px;
height: 75px;
margin: 0px auto;
}
#fb {
height: .89in;
width: .89in;
background-image:url("../images/facebook_dark.png");
}
#fb:hover {
height: .89in;
width: .89in;
background-image:url("../images/facebook_active.png");
目前,既沒有標誌顯示在我的 「socmed」 分區。任何人都知道我在做什麼錯了?難住了。
當你使用'檢查element'你會得到什麼? –
圖像的路徑是相對於CSS:http://stackoverflow.com/questions/940451/using-relative-url-in-css-file-what-location-is-it-relative-to –
所以目前我的目錄看起來像這樣。 style.css >>> CSS >>> index.html >>>圖片>>> facebook_active.png –