小试牛刀

2018-07-11  本文已影响0人  WANGLIN_HZ
<!DOCTYPE html>
<html>
<head>
    <title>背景</title>
    <style type="text/css">
        .box1{
            width: 1000px;
            height: 1000px;
            background-color: green;
            margin: 0 auto;
            background-image: url(img/by.jpg);
            background-repeat: repeat-y;

        }
    </style>
</head>
<body>
    <div class="box1"></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
    <title>背景</title>
    <style type="text/css">
        .box1{
            width: 1000px;
            height: 1000px;
            background-color: green;
            margin: 0 auto;
            background-image: url(img/by.jpg);
            background-repeat: repeat-y;

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

<!DOCTYPE html>
<html>
<head>
    <title>背景偏移与定位</title>
    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
        body{
            background-image: url();
            background-repeat: no-repeat;
            height: 5000px;
            background-attachment: fixed;
        }
        .box1{
            width: 500px;
            height: 500px;
            margin: 0 auto;
            background-color: rgb(220,230,220);
            background-repeat:no-repeat;
            background-image: url(img/1by.jpg);
            background-position: -50px -50px;
            background-repeat: no-repeat;
            background-attachment: fixed;
        }
    </style>
</head>
<body>
    <div class="box1"></div>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
    <title>按钮练习</title>
    <style type="text/css">
        .an:link{
            display: block;
            width: 500px;
            height: 400px;
            background-image: url();
            background-repeat: no-repeat;
        }
        .an:hover{
            /*background-image: url();*/
            background-position: -93 0px;

        }
        .an:active{
            /*background-image: url();*/
            background-position: -186 0px;
        }
    </style>
</head>
<body>
    <a href="#" class="an">超链接</a>
</body>
</html>
上一篇下一篇

猜你喜欢

热点阅读