布局文件:

    <html>
        <head> 
            <style type="text/css" >
                .container { 
                width:100px;height:100px;background:green;
                position:absolute;
                top:10px;
                left:0;
                right:0;
                margin:0 auto;
                transition:width 1s ease;
                } 
                .container:hover{
                    width:400px;
                }
            </style>
        </head>
        <body> 
            <div class="container"> </div>
        </body>
    </html>

    运行效果:

    1.gif