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

纯css加伪类实现关闭提示创窗口

时间:2016-04-25 22:41:00      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<title>单选按钮实现窗口关闭布局</title>
<meta name="author" content="" />
<style>
*{margin:0;padding:0;}
ul li{list-style:none;}
.first{
    position:relative;
    background:#0f0;
    width:500px;
}
.chk_1 { 
    display: none; 
} 
 
.chk_1 + label { 
    width:30px;
    height:30px;
    text-align:center;
    line-height:30px;
    background-color: #FFF; 
    background: rgba(255, 0, 107, 0.83); 
    padding: 5px; 
    display: inline-block; 
    position: absolute;
    right: 0;
    top: 0;
    z-index:2;
} 
 
.chk_1:checked + label { 
   display:none;
} 
 
.chk_1:checked + label:after { 
    display:none;
} 
.second{
    position:absolute;
    z-index:1;
    width:500px;
    height:300px;
    background:#FF00DF;
}
.chk_1:checked ~ div{
    display:none;
}
</style>
</head>
<body>
<div>
    <ul>
        <li class=‘first‘>
            <input type="checkbox" id="checkbox_a1" class="chk_1" /> 
            <label for="checkbox_a1">X</label> 
            <div class=‘second‘></div>
        </li>
    </ul>
</div>
</form>
</body>
</html>
            

 

纯css加伪类实现关闭提示创窗口

标签:

原文地址:http://www.cnblogs.com/13552492135qiaoyu/p/5432756.html

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