当前位置:网站首页>【案例】元素的显示与隐藏的运用--元素遮罩
【案例】元素的显示与隐藏的运用--元素遮罩
2022-07-05 20:56:00 【发呆少女】
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>遮罩</title>
<style> * {
margin: 0; padding: 0; } a {
text-decoration: none; } .news {
position: relative; width: 300px; height: 200px; margin: 20px auto; background-color: pink; } .news img {
width: 100%; height: 100%; } .news .cover {
display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.4); } .news .cover a {
position: absolute; width: 50px; height: 50px; top: 50%; margin-top: -25px; left: 50%; margin-left: -25px; } .news .cover a img {
width: 100%; height: 100%; } /* 鼠标经过是,让遮罩显示出来 */ /* 注意写法 */ .news:hover .cover {
display: block; } </style>
</head>
<body>
<div class="news">
<img src="./news.jpeg" alt="">
<!-- 鼠标经过时,出现遮罩 -->
<div class="cover">
<a href="#"><img src="./play.jpeg" alt=""></a>
</div>
</div>
</body>
</html>

边栏推荐
- Monorepo管理方法论和依赖安全
- Is it necessary for bazel to learn
- Research and development efficiency improvement practice of large insurance groups with 10000 + code base and 3000 + R & D personnel
- ts 之 属性的修饰符public、private、protect
- CareerCup它1.8 串移包括问题
- 判断横竖屏的最佳实现
- 启牛2980有没有用?开户安全吗、
- Write an interface based on flask
- Which is the best online collaboration product? Microsoft loop, notion, flowus
- Abbkine丨TraKine F-actin染色试剂盒(绿色荧光)方案
猜你喜欢
随机推荐
AI automatically generates annotation documents from code
Binary search
中国的软件公司为什么做不出产品?00后抛弃互联网;B站开源的高性能API网关组件|码农周刊VIP会员专属邮件周报 Vol.097
Abnova fluorescent dye 620-m streptavidin scheme
How to renew NPDP? Here comes the operation guide!
解析创客教育的知识迁移和分享精神
ViewRootImpl和WindowManagerService笔记
[UE4] unrealinsight obtains the real machine performance test report
如何让化工企业的ERP库存账目更准确
ts 之 类的简介、构造函数和它的this、继承、抽象类、接口
matplotlib绘图润色(如何形成高质量的图,例如设如何置字体等)
学习机器人无从下手?带你体会当下机器人热门研究方向有哪些
Is the securities account given by the school of Finance and business safe? Can I open an account?
Abnova e (diii) (WNV) recombinant protein Chinese and English instructions
当Steam教育进入个性化信息技术课程
php中explode函数存在的陷阱
示波器探头对信号源阻抗的影响
《SAS编程和数据挖掘商业案例》学习笔记# 19
研學旅遊實踐教育的開展助力文旅產業發展
Abnova blood total nucleic acid purification kit pre installed relevant instructions









