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

css高级样式

时间:2016-01-30 13:51:40      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>BFC</title>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>图片替换技术</title>
    <style type="text/css">

        h1 {
            width: 168px;
            height: 81px;
            background: url("京东LOGO.png");
            border: 1px solid black;
        }

        a{
            border: 1px solid #ff0000;
            width: 168px;
            height: 81px;
            display: block;
            text-indent: -1000px;
        }

    </style>



</head>
<body>


    <h1><a href="定位.html">京东</a></h1>

</body>
</html>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>图片透明效果</title>
    <style type="text/css">
        img{
            opacity: 0.4;
            /*background: rgba(0,0,0,0.6);*/
        }
        img:hover{
            opacity: 1;
        }
        /*此处不能使用rgba改变背景透明的方式来做效果,因为,rgba只针对背景颜色改变,*/
        /*而opacity针对是整个元素透明效果的改变*/
    </style>
</head>
<body>
    <img src="sprites2.png" alt=""/>
</body>
</html>

 

    <style type="text/css">
        .out{
            width: 200px;
            height: 200px;
            background: yellow;
            overflow: hidden;
        }
        .in{
            width: 100px;
            height: 100px;
            background: green;
            margin-top: 50px;
            position: static;
            z-index: -1;
        }


    </style>


</head>
<body>
    <div class="out">
        <div class="in"></div>
    </div>


</body>
</html>

 

css高级样式

标签:

原文地址:http://www.cnblogs.com/Lixuemei/p/5170867.html

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