css总结系列之一

来源:互联网 发布:现在淘宝代销好做吗 编辑:程序博客网 时间:2024/05/16 00:31

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>




原创粉丝点击