首页 > Web开发 > 详细

CSS实战3

时间:2018-04-27 11:52:44      阅读:151      评论:0      收藏:0      [点我收藏+]

 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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!