zoukankan      html  css  js  c++  java
  • cssposition

    描述
    absolute

    生成绝对定位的元素,相对于 static 定位以外的第一个父元素进行定位。

    元素的位置通过 "left", "top", "right" 以及 "bottom" 属性进行规定。(简单情况下相对于浏览器窗口)

    fixed

    生成绝对定位的元素,相对于浏览器窗口进行定位。

    元素的位置通过 "left", "top", "right" 以及 "bottom" 属性进行规定。

    relative

    生成相对定位的元素,相对于其正常位置进行定位。

    因此,"left:20" 会向元素的 LEFT 位置添加 20 像素。

    static 默认值。没有定位,元素出现在正常的流中(忽略 top, bottom, left, right 或者 z-index 声明)。
    inherit 规定应该从父元素继承 position 属性的值。

    <html>
    <head>
    <style type="text/css">
    .text{
    position:relative;
    top:30px;
    left:40px;
    }
    .testspan{
    position:relative;
    top:30px;
    left:20px;
    }
    </style>
    </head>
    <body>
    <table border="1">
    <td width="100" height="100"><span class="text">button1</span></td>
    <td>
    <input type="hidden" id="abc">
    <div style="50"></div>
    <span class="testspan">
    <input type="button" class="button1" value="click">
    </span>
    </td>
    </table>
    </body>
    </html>

  • 相关阅读:
    解决SSH连接Linux超时自动断开
    小程序选项卡
    vue 封装axios 请求 统一管理方法1
    vue 中使用echar
    vue element 做表格分页
    vue echar使用
    旋转
    vue 登录切换页面
    vue 根据输入的身份号码,自动获取年龄
    vue 手机号码验证 。点击获取验证码
  • 原文地址:https://www.cnblogs.com/jphoebe/p/5050278.html
Copyright © 2011-2022 走看看