課程
/前端開發(fā)
/HTML/CSS
/回到頂部效果
背景圖不能顯示
2015-11-19
源自:回到頂部效果 3-1
正在回答
<!DOCTYPE?html> <html> <head> ????<title>?new?document?</title> ????<meta?charset="UTF-8"> ????<style> ????????#btn?{ ????????????width:?40px; ????????????height:?40px; ????????????position:?fixed; ????????????right:?65px; ????????????bottom:?10px; ????????????display:?inline-block; ????????????background:?url(http://upload.hj.cn/2015/1104/1446619991843.jpg)?no-repeat?-43px?-79px; ????????} ????????#btn:hover?{ ????????????background:?url(http://upload.hj.cn/2015/1104/1446619991843.jpg)?no-repeat?-288px?-39px; ????????} ????????.bg{ ????????????width:?1190px; ????????????width:?auto; ????????} ????</style> </head> <body> <a?href=""?id="btn">回到頂部</a> <div?class="bg"><img?style="width:?100%"?src="http://upload.hj.cn/2015/1104/1446619991843.jpg"?alt=""></div> </body> </html>
咋就那么難呢? 我這圖片的坐標(biāo)位置你不用關(guān)注,因?yàn)槲矣玫氖峭粡垐D,標(biāo)到那個(gè)位置只是為了看的更明顯
1348448970 提問者
看圖片
李曉健
1348448970 提問者 回復(fù) 李曉健
李曉健 回復(fù) 1348448970 提問者
display: none; ?還顯示什么?
#btn {
width: 40px;
height: 40px;
position: fixed;
right: 65px;
bottom: 10px;
display: none;
background: url(img/top_bg.png) no-repeat left top;
}
#btn:hover {
background: url(img/top_bg.png) no-repeat 0 -39px;
給出你的完整代碼 ?別人才能看出你的問題
舉報(bào)
回到頂部網(wǎng)站不可缺少的一部分,用JS實(shí)現(xiàn)炫酷拉風(fēng)的回到頂部效果
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2015-11-21
咋就那么難呢? 我這圖片的坐標(biāo)位置你不用關(guān)注,因?yàn)槲矣玫氖峭粡垐D,標(biāo)到那個(gè)位置只是為了看的更明顯
2015-11-20
看圖片
2015-11-20
display: none; ?還顯示什么?
2015-11-20
#btn {
width: 40px;
height: 40px;
position: fixed;
right: 65px;
bottom: 10px;
display: none;
background: url(img/top_bg.png) no-repeat left top;
}
#btn:hover {
background: url(img/top_bg.png) no-repeat 0 -39px;
}
2015-11-19
給出你的完整代碼 ?別人才能看出你的問題