這篇文章主要介紹“怎么用css實(shí)現(xiàn)熱點(diǎn)鏈接當(dāng)鼠標(biāo)懸停時(shí)出現(xiàn)白色的框”,在日常操作中,相信很多人在怎么用css實(shí)現(xiàn)熱點(diǎn)鏈接當(dāng)鼠標(biāo)懸停時(shí)出現(xiàn)白色的框問題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”怎么用css實(shí)現(xiàn)熱點(diǎn)鏈接當(dāng)鼠標(biāo)懸停時(shí)出現(xiàn)白色的框”的疑惑有所幫助!接下來,請(qǐng)跟著小編一起來學(xué)習(xí)吧!
類似熱點(diǎn)鏈接的一段小代碼:利用定位實(shí)現(xiàn)。
這個(gè)好像是沒有什么可多說的。
看過定位這個(gè)概念的,都能理解。
代碼如下:
<html>
<head>
<style>
*{margin:0px;padding:0px;}
body{text-align:center;}
.body{width:200px;height:auto;position:relative;text-align:left;margin:0 auto;}
.ourImg{width:200px;padding:3px;background:#eee;border:1px solid #aaa;height:auto;}
.body ul{list-style-type:none;}
.body a .hotspot{width:100px;height:150px;position:absolute;}
.body .MM a .hotspot{top:10px;left:15px;}
.body a .link{position:absolute;display:block;width:10em;right:-11em;cursor:pointer;}
.body .MM a .link{top:5px;color:#0066FF;}
.body a:hover .hotspot,.body a:focus .hotspot{border:1px solid #FFF;}
.body a:hover .link,.body a:focus .link{color:#0066FF;}
</style>
</head>
<body>
<div class = "body">
<img src = "img1.jpg" alt = "MM" class = "ourImg"/>
<ul>
<li class = "MM">
<a href = "#" title = "MM">
<span class = "hotspot"></span>
<span class = "link">MM</span>
</a>
</li>
</ul>
</div>
</body>
</html>
效果圖如下:當(dāng)鼠標(biāo)懸停到MM字樣時(shí),圖片中就會(huì)出現(xiàn)一個(gè)白色的框
到此,關(guān)于“怎么用css實(shí)現(xiàn)熱點(diǎn)鏈接當(dāng)鼠標(biāo)懸停時(shí)出現(xiàn)白色的框”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!
文章名稱:怎么用css實(shí)現(xiàn)熱點(diǎn)鏈接當(dāng)鼠標(biāo)懸停時(shí)出現(xiàn)白色的框-創(chuàng)新互聯(lián)
瀏覽路徑:http://www.chinadenli.net/article0/dshgoo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站設(shè)計(jì)、企業(yè)建站、建站公司、企業(yè)網(wǎng)站制作、外貿(mào)建站、網(wǎng)站設(shè)計(jì)公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容