手机
当前位置:查字典教程网 >网页设计 > Div+Css教程 >css简单实现热点链接当鼠标悬停时出现白色的框
css简单实现热点链接当鼠标悬停时出现白色的框
摘要:类似热点链接的一段小代码:利用定位实现。这个好像是没有什么可多说的。看过定位这个概念的,都能理解。*{margin:0px;padding:...

类似热点链接的一段小代码:利用定位实现。

这个好像是没有什么可多说的。

看过定位这个概念的,都能理解。

<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>

效果图如下:当鼠标悬停到MM字样时,图片中就会出现一个白色的框

1

【css简单实现热点链接当鼠标悬停时出现白色的框】相关文章:

纯CSS实现的鼠标经过文本时提示的信息

如何去掉图片点击后的超级链接产生的虚框问题

CSS+DIV实现鼠标经过背景变色

css实现文字的自动隐藏

css按钮自适应实现原理及代码

一款纯css实现的垂直时间线效果

用css3实现当鼠标移进去时当前亮其他变灰效果

css去除点击链接时出现的虚线框

css实现连续的英文或数字自动换行的方法

css实现图片在div中居中的效果

精品推荐
分类导航