a标签突出显示盒子非js效果
2017-07-29 17:34
141 查看
鼠标放在相应的标题上,显示对应的盒子
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
a{
text-decoration: none;
color: #000;
}
.box{
width: 300px;
height: 300px;
position: relative;
border: 1px solid #000;
}
ul li{
list-style: none;
float: left;
display: block;
}
.box1{
width: 200px;
height: 200px;
background-color: red;
position: absolute;
left: 40px;
top: 40px;
display: none;
}
.box2{
width: 200px;
height: 200px;
background-color: blue;
position: absolute;
left: 40px;
top: 40px;
display: none;
}
ul li:first-child:hover .box1{
display: block;
}
ul li:nth-child(2):hover .box2{
display: block;
}
</style>
</head>
<body>
<div class="box">
<ul>
<li>
点击显示1
<div class="box1"></div>
</li>
<li>
点击显示2
<div class="box2"></div>
</li>
</ul>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
a{
text-decoration: none;
color: #000;
}
.box{
width: 300px;
height: 300px;
position: relative;
border: 1px solid #000;
}
ul li{
list-style: none;
float: left;
display: block;
}
.box1{
width: 200px;
height: 200px;
background-color: red;
position: absolute;
left: 40px;
top: 40px;
display: none;
}
.box2{
width: 200px;
height: 200px;
background-color: blue;
position: absolute;
left: 40px;
top: 40px;
display: none;
}
ul li:first-child:hover .box1{
display: block;
}
ul li:nth-child(2):hover .box2{
display: block;
}
</style>
</head>
<body>
<div class="box">
<ul>
<li>
点击显示1
<div class="box1"></div>
</li>
<li>
点击显示2
<div class="box2"></div>
</li>
</ul>
</div>
</body>
</html>
相关文章推荐
- a标签突出显示盒子非js效果
- Js实现当前点击a标签变色突出显示其他a标签回复原色
- Js实现当前点击a标签变色突出显示其他a标签回复原色
- jquery教程:仿miqike.com首页"热门标签"层绝对定位 点击隐藏/点击显示JS效果
- css效果,在一个盒子里,把一部分内容隐藏掉,在鼠标悬停到div时,就会把隐藏的部分向上显示出来。 不用js操作,纯css就可以。
- Bootstrap实现的标签页内容切换显示效果示例
- 使用v-html解决Vue.js渲染过程中html标签不能被解析(html标签显示为字符串)
- 值的收藏的js效果: 滚动条下拉时,右下角显示弹出框
- JS加jquery简单实现标签元素的显示或隐藏
- JS、jquery实现几分钟前、几小时前、几天前等时间差显示效果的代码实例分享
- JS@DOM:向表格中动态添加行显示信息,做到滚动效果
- 一个js简单的日历显示效果的函数
- JS实现密码框根据焦点的获取与失去控制文字的消失与显示效果
- js鼠标移上去当前放大图片突出显示特效代码
- IE6 下JS改变IMG标签SRC不显示的问题[终级方法]
- js 标签隔行显示颜色
- FileLoad 直接显示到img标签中 实现预览效果
- JS 时间显示效果代码
- JS实现标签效果
- JS实现鼠标经过用户头像显示资料卡的效果,可点击