課程
/前端開發
/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>
咋就那么難呢? 我這圖片的坐標位置你不用關注,因為我用的是同一張圖,標到那個位置只是為了看的更明顯
1348448970 提問者
看圖片
李曉健
1348448970 提問者 回復 李曉健
李曉健 回復 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;
給出你的完整代碼 ?別人才能看出你的問題
舉報
回到頂部網站不可缺少的一部分,用JS實現炫酷拉風的回到頂部效果
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2015-11-21
<!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>咋就那么難呢? 我這圖片的坐標位置你不用關注,因為我用的是同一張圖,標到那個位置只是為了看的更明顯
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
給出你的完整代碼 ?別人才能看出你的問題