css总结系列之一

1、CSS上下左右居中布局

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <style>
            .right{
                position: absolute;
                top: 50px;
                right: 0px;
                bottom: 50px;
                width: 300px;
                text-align: center;
                border: 1px solid blue;
            }
            /*上下左右居中布局*/
            .rightContent{
                position: absolute;
                top: 50%;
                bottom: 50%;
                height: 20px;
            }
        </style>
    </head>
    <body>
        <div class="right">
            <span class="rightContent">右DIV显示的内容</span>
        </div>
    </body>
</html>




你可能感兴趣的:(css,Class,div,border)