css基礎精華04

來源:互聯網
上載者:User
<!DOCTYPE html><!--CSS常用操作-對齊--><html><head lang="en">    <meta charset="UTF-8">    <title></title>    <link href="css04.css" rel="stylesheet" type="text/css"></head><body>    <div></div></body>

</html>

css:

*{    margin: 0px;}/*使用margin對齊*/div {    width: 60%;    height: 500px;    /*置中對齊*/    /*表示上下100px,左右自適應*/    margin: 100px auto;    /*margin-left: auto;*/    /*margin-right: auto;*/    background-color: #ffff00;}/*使用position對齊*//*div{width: 60%;height: 500px;絕對布局position: absolute;right: 0px;background-color: aqua;}*//*float浮動對齊*//*div{    width: 60%;    height: 500px;    float: left;    background-color: aqua;}*/

相關文章

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.