zoukankan      html  css  js  c++  java
  • 鼠标悬停在图片上出现蒙层的方法

    关于蒙层实现的不同方法,我们可以用CSS和jQuery两种方法

    Jquery方法

    首先看一下HTML代码:

    `




    孤独症儿童行为检查量表(ABC)


    已有777人参与



    孤独症儿童行为检查量表(ABC)


    立即参与


    ` ##### css代码: `.list_images { position: relative; 1000px; margin: 0 auto; text-align: center; } .content { margin-left: 26px; margin-top:18px; margin-bottom: 1%; height: 200px; 30%; position: relative; cursor: pointer; display: inline-block; box-shadow: 0px 3px 3px 0px rgb(0,0,0,0.05); } h3 { position: relative; color: #484848; font-size: 16px; font-weight: bold; left: 0px; } p { position: relative; left: -10px; color: #aaaaaa; font-size: 12px; } .mask { height: 100%; 100%; position: absolute; top: 0px; display: none; background-color: rgba(0, 0, 0, 0.5); color: #EEEEEE; font-size: 20px; } .mask_title { font-size:16px; margin-top: 20%; text-align: center; } .mask_btn { display: inline-block; text-decoration: none; color: #eee; 100px; height: 28px; line-height: 28px; font-size: 14px; text-align: center; border-radius: 14px; background: #5691fe; list-style: none; cursor: pointer; margin-top: 20px; } ` #####jquery代码: `` ###Css方法: #####只需要在css样式中再添加.content:hover .mask {display: block;} #####Css 代码: `.list_images { position: relative; 1000px; margin: 0 auto; text-align: center; } .content { margin-left: 26px; margin-top:18px; margin-bottom: 1%; height: 200px; 30%; position: relative; cursor: pointer; display: inline-block; box-shadow: 0px 3px 3px 0px rgb(0,0,0,0.05); } h3 { position: relative; color: #484848; font-size: 16px; font-weight: bold; left: 0px; } p { position: relative; left: -10px; color: #aaaaaa; font-size: 12px; } .mask { height: 100%; 100%; position: absolute; top: 0px; display: none; background-color: rgba(0, 0, 0, 0.5); color: #EEEEEE; font-size: 20px; } .mask_title { font-size:16px; margin-top: 20%; text-align: center; } .mask_btn { display: inline-block; text-decoration: none; color: #eee; 100px; height: 28px; line-height: 28px; font-size: 14px; text-align: center; border-radius: 14px; background: #5691fe; list-style: none; cursor: pointer; margin-top: 20px; } .content:hover .mask {display: block;}` ####效果图 ![](https://img2018.cnblogs.com/blog/1638097/201904/1638097-20190428105930499-770507610.png) ***----------------------------------------------------------------------------------------------------*** ![](https://img2018.cnblogs.com/blog/1638097/201904/1638097-20190428110006037-566627623.png)
  • 相关阅读:
    document.ready和window.onload的区别
    那些年,我们坚持着。
    JavaScript去除前后空格
    男孩的梦
    shapefile格式说明及读写代码示例 http://www.gispower.org/article/arcgis/arcother/2008/48/0848115049GB922C13K2I22H7G06A4.html
    如何在C#中加载自己编写的动态链接库(DLL)http://www.kehui.net/index.php/article/read/30/26323
    对象复制
    影像复制程序集在不关闭应用程序的前提下更新程序集
    ibatisnet系列(一) 总览 http://hjf1223.cnblogs.com/archive/2006/04/24/383118.html
    创建项模板模板参数
  • 原文地址:https://www.cnblogs.com/hellogmy/p/10782569.html
Copyright © 2011-2022 走看看