首页 技术 正文
技术 2022年11月18日
0 收藏 560 点赞 3,446 浏览 910 个字
1.visibility:hidden;
2.display: none;区别:
1.visibility:hidden 隐藏元素本身,且在网页中 占位置
2.display:none; 隐藏元素本身,且在网页中不占用位置,脱标开发中常用:
display:none;隐藏 display:block 显示出来

使用案例:鼠标经过弹出下载二维码导航

html结构代码
<body>
<div class="box">
<div class="centerbox">
<ul>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >平台导航</a></li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >平台导航</a></li>
<li class="abc"><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >平台导航</a>
<img src="./images/code.jpg" alt="">
</li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >app下载</a> </li>
<li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >平台导航</a></li> </ul>
</div> </div>
</body>

CSS结构代码

<style>
.box{
height: 37px;
border-top: 1px solid red;
border-bottom: 1px solid red;
}
.centerbox{
width: 1075px;
margin: 0 auto;
}
ul{
padding: 0;
margin: 0;
list-style: none;
}
ul li{
float: left;
width: 215px;
height: 37px;
border-right: 1px solid red;
box-sizing: border-box;
text-align: center;
line-height: 37px;
}
ul li:last-child {
border-right: 0;
}
ul li a{
text-decoration: none;
color: #0c0c0c;
}
ul .abc{
position: relative;
}
ul .abc img{
position: absolute;
top:33px;
left: 46px;
display: none;
}
ul .abc:hover img{
display: block;
}
</style>
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,075
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,551
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,399
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,176
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,811
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,893