zoukankan      html  css  js  c++  java
  • positive 相对其正常位置,那什么是正常位置: 请问调试,请问浏览器

     【问题代码

    <!DOCTYPE html>
    <html>
    <head>
    <title></title>
    <meta charset="utf-8">
    <style type="text/css">
    * {
    margin: 0;
    padding: 0;
    border: 0;
    }

    .top {
    background-color: black;
    1920px;
    height: 40px;
    }

    .body {
    background-color: red;
    1200px;
    height: 200px;
    margin: 0 auto;

    }

    .left {
    background-color: yellow;
    200px;
    height: 80px;
    float: left;

    }

    .centen {
    background-color: blue;
    200px;
    height: 40px;
    margin: 0 auto;
    margin-top: 10px;

    }

    .right {
    background-color: green;
    200px;
    height: 80px;
    float: right;
    }
    </style>
    </head>
    <body>
    <div class="top"></div>
    <div class="body">
    <div class="left"></div>
    <div class="centen"></div>
    <div class="right"></div>
    </div>
    </body>
    </html>

    <!DOCTYPE html>
    <html>
    <head>
    <title></title>
    <meta charset="utf-8">
    <style type="text/css">
    * {
    margin: 0;
    padding: 0;
    border: 0;
    }

    .top {
    background-color: black;
    1920px;
    height: 40px;
    }

    .body {
    background-color: red;
    1200px;
    height: 200px;
    margin: 0 auto;
    margin-top: 10px;
    }

    .w200 {
    200px;
    }

    .h80 {
    height: 80px;
    }

    .h40 {
    height: 40px;
    }

    .left_content_right {
    /*相对其正常位置*/
    position: relative;
    }

    .left {
    background-color: yellow;
    }

    .centen {
    background-color: blue;
    /*relative 相对正常位置,调试确定其正常位置;*/
    margin: 0 auto;
    /*60=40+20*/
    margin-top: -60px;
    }

    .right {
    background-color: green;
    /*relative 相对正常位置,margin-top: -60px;float: right;*/
    float: right;
    margin-top: -60px;
    }
    </style>
    </head>
    <body>
    <div class="top"></div>
    <div class="body">
    <div class="left w200 h80 left_content_right"></div>
    <div class="centen w200 h40 left_content_right"></div>
    <div class="right w200 h80 left_content_right"></div>
    </div>
    </body>
    </html>



  • 相关阅读:
    使用Maven快速创建一个SpringMVC工程步骤
    签到
    yaml简介
    APP定位元素之UiSelector
    js中var、let、const区别
    用Jquery去写树结构
    正则相关的知识分享
    python常见问题
    Vue.js 的一些小技巧
    关于jsp删除成功,添加成功等之后 页面自动跳转的js写法
  • 原文地址:https://www.cnblogs.com/rsapaper/p/8011335.html
Copyright © 2011-2022 走看看