码迷,mamicode.com
首页 > Web开发 > 详细

CSS实战3

时间:2018-04-27 12:15:47      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:position   opacity   relative   div   hover   meta   实战   src   border   

 1. z-index  层级   div 层

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
       /* .test {
            width: 150px;
            height: 300px;
            border: 1px solid #ccc;
            margin-top: 100px;
            float: left;
            margin-left: -1px;
        }
        .test:hover {
            border: 1px solid #f40;
            position: relative;
        } */
        .test {
            width: 150px;
            height: 300px;
            border: 1px solid #ccc;
            margin-top: 100px;
            float: left;
            margin-left: -1px;
            position: relative;
        }
        .test:hover {
            border: 1px solid #f40;
            z-index: 1;

        }
    </style>
</head>
<body>
<div class="test"></div>
<div class="test"></div>
<div class="test"></div>
<div class="test"></div>
<div class="test"></div>
</body>
</html>

技术分享图片

2.背景半透明

CSS3

background: rgba(0,0,0,0.5); 

opacity: 0.5; 让盒子半透明   里面的内容也半透明

 

CSS实战3

标签:position   opacity   relative   div   hover   meta   实战   src   border   

原文地址:https://www.cnblogs.com/lhh520/p/8961030.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!