欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!
<!DOCTYPE html>
 
<html>
 
    <head>
 
        <meta charset="utf-8">
 
        <title></title>
 
        <style type="text/css">
 
            ul,li{list-style: none;margin: 0;padding: 0;}
 
            ul{
 
                width: 900px;height: 220px;
 
                margin: 50px auto;
 
            }
 
            ul li{
 
                width: 200px;height: 200px;
 
                border: 3px solid black;
 
                float: left;
 
                background: url(10课堂素材/01.jpg);
 
                background-size: 200px;
 
                position: relative;
 
                overflow: hidden;
 
            }
 
            li:nth-child(2){
 
                background: url(10课堂素材/02.jpg);
 
                background-size: 200px;
 
            }
 
            li:nth-child(3){
 
                background: url(10课堂素材/03.png);
 
                background-size: 250px;
 
            }
 
            .li:nth-child(4){
 
                background: url(10课堂素材/04.png);
 
                background-size: 200px;
 
            }
 
            ul li hgroup{
 
                width: 200px;height: 200px;
 
                position: absolute;
 
                top:220px;
 
                left:0px;
 
                background: rgba(255,255,255,0.5);
 
                transition: all 2s;
 
            }
 
            ul li:hover hgroup{
 
                display: block;
 
                position: absolute;
 
                top:0px;
 
                left: 0px;
 
            }
 
        </style>
 
    </head>
 
    <body>
 
        <ul>
 
            <li>
 
                <hgroup>
 
                    <p>waiting for you</p>
 
                    <h2>接下来</h2>
 
                </hgroup>
 
            </li>
 
            <li>
 
                <hgroup>
 
                    <p>waiting for you</p>
 
                    <h2>请欣赏</h2>
 
                </hgroup>
 
            </li>
 
            <li>
 
                <hgroup>
 
                    <p>waiting for you</p>
 
                    <h2>页面效果</h2>
 
                </hgroup>
 
            </li>
 
            <li>
 
                <hgroup>
 
                    <p>waiting for you</p>
 
                    <h2>滑动</h2>
 
                </hgroup>
 
            </li>
 
        </ul>
 
    </body>
 
</html>

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/html/h64224.shtml