zoukankan      html  css  js  c++  java
  • position

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="./dsmd.css">
    <title>Document</title>
    </head>
    <body>
    <div class="box" id="one">One</div>
    <div class="box" id="two">Two</div>
    <div class="box" id="three">Three</div>
    <div class="box" id="four">Four</div>
    </body>
    </html>
     
     
    dsmd.css
    .box {
    display: inline-block;
    100px;
    height: 100px;
    background: red;
    color: white;
    }
     
    #two {
    position: absolute;//探究position中static、absolute、relative、fixed、sticky的区别
    top: 20px;
    left: 20px;
    background: blue;
    }
     
  • 相关阅读:
    第二十一天作业
    第二十天:继承
    第二十天作业
    第十六天
    第十九天作业
    day53
    day52
    day51
    day50
    day44
  • 原文地址:https://www.cnblogs.com/wxc2/p/9698991.html
Copyright © 2011-2022 走看看