css總結系列之一

來源:互聯網
上載者:User

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>

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.