前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >伪类,图片中出现文字·

伪类,图片中出现文字·

作者头像
Wyc
发布2018-09-11 11:25:53
5670
发布2018-09-11 11:25:53
举报
文章被收录于专栏:Python研发Python研发

鼠标放进图片之后:

鼠标没放进图片之前:

代码语言:javascript
复制
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .touch{
            width: 200px;
            height: 200px;
            overflow: hidden;
            position: relative;
        }
        .touch .content{
            position: absolute;
            top:0;
            height: 0;
            left: 0;
            bottom: 0;
            opacity: 0.6;
            color: black;
            text-align: center;
            visibility: hidden;
        }
        .touch:hover .content{
            visibility: visible;
        }
        .touch .content .c1{
            font-size: 32px;
            padding: 30px 0;
        }
    </style>
</head>
<body>
    <div class="touch">
        <div><img src="2.jpg"></div>
        <div class="content">
            <div class="c1">NiHao</div>
            <div class="c2">Wyc</div>
        </div>
    </div>
</body>
</html>



# visibility: hidden;       透明度隐藏
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2016-07-05 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档