zoukankan      html  css  js  c++  java
  • position_relative+absolute 搭配使用,实现绝对定位 放大缩小都不影响其绝对位置

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
        <div style="position: relative; 500px; height:200px; border: 1px red solid;margin: 0 auto; ">
            <div style="position: absolute; 50px; height:50px; background-color:#411000; top: 0;left:0;"></div>
        </div>
    
        <div style="position: relative; 500px; height:200px; border: 1px red solid;margin: 0 auto; ">
            <div style="position: absolute; 50px; height:50px; background-color:#411000; bottom: 0;left:0;"></div>
        </div>
    
        <div style="position: relative; 500px; height:200px; border: 1px red solid;margin: 0 auto; ">
            <div style="position: absolute; 50px; height:50px; background-color:#411000; bottom: 0;right:0;"></div>
        </div>
    </body>
    </html>
    
    <!--
    relative+absolute 搭配使用,实现绝对定位  放大缩小都不影响其绝对位置
    -->

    效果:

  • 相关阅读:
    selenium自动化测试实战——12306铁路官网范例
    mock接口开发——flask模块
    python调用接口——requests模块
    python操作redis
    python修改excel内容
    python读excel
    python发送邮件
    python写日志
    python的模块
    python写excel
  • 原文地址:https://www.cnblogs.com/chenjw-note/p/12703510.html
Copyright © 2011-2022 走看看