/*透明度设置的两种方式,以及hover的用法,fixed,(relative,absolute)这两个一起用*/

 1 <!DOCTYPE html>
 2 /*透明度设置的两种方式,以及hover的用法,fixed,(relative,absolute)这两个一起用*/
 3 <html lang="en">
 4 <head>
 5     <meta charset="UTF-8">
 6     <title>Title</title>
 7     <style>
 8         .touch:hover .content{
 9             visibility: visible;/*显示*/
10 
11         }
12         .touch{
13             width: 200px;
14             height: 200px;
15             overflow: hidden;
16             position: relative;
17         }
18         .touch .content{
19             position: absolute;
20             top: 0;
21             left: 0;
22             right: 0;
23             bottom: 0;
24             color:white;
25             /*background-color: black;*/
26             /*opacity: 0.5;*/
27             background-color:rgba(0,0,0,.5);/*透明度设置的两种方式*/
28             text-align: center;
29             visibility: hidden;/* 隐藏*/
30         }
31         .touch .c1{
32             font-size: 32px;
33         }
34     </style>
35 </head>
36 <body>
37     <div class="touch">
38         <div><img src="1.jpg"></div>
39         <div class="content">
40             <div class="c1">ALEX</div>
41             <div>500-1000(日)</div>
42          </div>
43     </div>
44 </body>
45 </html>

 

转载于:https://www.cnblogs.com/shiluoliming/p/6511720.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值