当前位置:网站首页>【案例】元素的显示与隐藏的运用--元素遮罩
【案例】元素的显示与隐藏的运用--元素遮罩
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>
边栏推荐
- AI automatically generates annotation documents from code
- Abnova blood total nucleic acid purification kit pre installed relevant instructions
- PHP反序列化+MD5碰撞
- ODPS 下一个map / reduce 准备
- Abnova 环孢素A单克隆抗体,及其研究工具
- Interpreting the daily application functions of cooperative robots
- MySQL fully parses json/ arrays
- wpf 获取datagrid 中指定行列的DataGridTemplateColumn中的控件
- Where is a good stock account? Is online account manager safe to open an account
- 示波器探头对测量带宽的影响
猜你喜欢
Duchefa low melting point agarose PPC Chinese and English instructions
实现浏览页面时校验用户是否已经完成登录的功能
Abnova丨血液总核酸纯化试剂盒预装相关说明书
AI automatically generates annotation documents from code
培养机器人教育创造力的前沿科技
Use of form text box (II) input filtering (synthetic event)
leetcode:1755. 最接近目标值的子序列和
解析创客教育的知识迁移和分享精神
Phpstudy Xiaopi's MySQL Click to start and quickly flash back. It has been solved
如何让化工企业的ERP库存账目更准确
随机推荐
基于AVFoundation实现视频录制的两种方式
XML建模
Prosci LAG-3 recombinant protein specification
php中explode函数存在的陷阱
解析创客教育的知识迁移和分享精神
Learning notes of SAS programming and data mining business case 19
Prior knowledge of machine learning in probability theory (Part 1)
Typhoon is coming! How to prevent typhoons on construction sites!
Abnova CRISPR spcas9 polyclonal antibody protocol
获取前一天的js(时间戳转换)
概率论机器学习的先验知识(上)
Use of thread pool
Norgen AAV extractant box instructions (including features)
Abnova CD81 monoclonal antibody related parameters and Applications
Binary search
从架构上详解技术(SLB,Redis,Mysql,Kafka,Clickhouse)的各类热点问题
Abnova丨CRISPR SpCas9 多克隆抗体方案
Is the securities account given by the school of Finance and business safe? Can I open an account?
线程池的使用
Write an interface based on flask