學習進度更新 2017-6-18

本週,學習進度到CSS第三天,過渡應用,接下去要學習動畫

CSS還有2天的課程

爭取在下週可以完成

總結一下這周的收貨:

CSS3的過渡和動畫效果,可以很方便的取代JS


發佈一下今天學習遇到的一個小技巧,用 position: relative 後,背景圖片拉昇,效果會維持現有位置。

    <style>

<style>
    * {
        margin: 0;
        padding: 0;
    }
    
    .bigger {
    	margin: 0 auto;
        width: 200px;
        height: 200px;
        background-image: url(images/bg.jpg);
        background-size: 100% auto;
        transition: 2s;
        background-position: center;
        position: relative;
    }
    
    .bigger:hover {
        background-size: 120% auto;
        background-position: center;
    }
    </style>
</head>


<body>
    <div class="bigger">
    </div>
</body>


    * {
        margin: 0;
        padding: 0;
    }
    
    .bigger {
    margin: 0 auto;
        width: 200px;
        height: 200px;
        background-image: url(images/bg.jpg);
        background-size: 100% auto;
        transition: 2s;
        background-position: center;
        position: relative;
    }
    
    .bigger:hover {
        background-size: 120% auto;
        background-position: center;
    }
    </style>
</head>


<body>
    <div class="bigger">
    </div>
</body>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章