从【 two1-4 】分别为absolute,fixed,static,relative标签

四个标签下位移值相同,【 two2 】和【 two1 】都出现在左上角,【 two2 】 盖住了【 two1 】

附上部分源代码:

  HTML:

    <div class="box" id="one">One</div>
    <div class="box" id="two1">Two1</div>
    <div class="box" id="three">Three</div>
    <div class="box" id="four">Four</div>

  CSS:

    .box {
    display: inline-block;
    width: 100px;
    height: 100px;
    background: #ff8353;
    color: white;
    }

    

    #two1 {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #452589;
    }

    body
    {
    height:4000px;
    }

two4 】为relative标签,出现在正常流当中,能设置位移

two3 】为static标签,出现在正常流当中,不能设置位移

two2 】为fixed标签,不出现在正常流当中,不能设置位移,随页面滚动

two1 】为absolute标签,不出现在正常流当中,能设置位移

如图的【 two2 】为fixed标签页面滑动效果

----关于position的四个标签----的更多相关文章

  1. Position属性四个值:static、fixed、absolute和relative的区别和用法

    Position属性四个值:static.fixed.absolute和relative的区别和用法 在用CSS+DIV进行布局的时候,一直对position的四个属性值relative,absolu ...

  2. position的四个属性值

    1.relative2.absolute3.fixed4.static下面分别讲述这四个属性. <div id="parent"> <div id="s ...

  3. Git学习笔记(四)标签和搭建Git服务

    一.标签是什么 发布一个版本时,我们通常先在版本库中打一个标签,这样,就唯一确定了打标签时刻的版本.将来无论什么时候,取某个标签的版本,就是把那个打标签的时刻的历史版本取出来.所以,标签也是版本库的一 ...

  4. struts1四:常用标签

    struts1支持的5种标签: HTML 标签: 用来创建能够和Struts 框架和其他相应的HTML 标签交互的HTML 输入表单 Bean 标签: 在访问JavaBeans 及其属性,以及定义一个 ...

  5. kendo chart label position 图表的值标签位置及显示模板

    1.不显示0 seriesDefaults: { type: "column", labels: { visible: true, position:'' background: ...

  6. position的四种定位方式:static、fixed、relative、absolute

    position属性用来规定元素的定位类型和方式 ①position:static 默认值,没有定位,元素出现在正常的流中: ②position:fixed  固定定位 是相对于浏览器窗口来进行定位: ...

  7. mybatis学习 十四 resultMap标签 一对一(联合查询)

    1.使用 resultMap 实现关联单个对象(联合查询方式) <resultMap type="Student" id="stuMap1"> &l ...

  8. django第四课 标签的用法(if/else、for、ifequal、过滤器、注释等)

    if/else {% if %} <p>内容</P> {% endif %} {% else %}是可选标签 {% if %} <p>内容</P> {% ...

  9. GitHub笔记(四)——标签管理

    五 标签管理 1 打标签.默认master $ git tag v1.0 要对add merge这次提交打标签,它对应的commit id是f52c633,敲入命令: $ git tag v0.9 f ...

随机推荐

  1. Java异常学习总结一

    Java中的异常 定义 异常(Exception)就是在程序的运行过程中所发生的不正常的事件,它会中断正在运行的程序. 常见类型举例 所需文件找不到(ClassNotFoundException) 网 ...

  2. BasicConverter 基本数据类型转换器

    package cn.ubibi.jettyboot.framework.commons; import com.alibaba.fastjson.JSON; import com.alibaba.f ...

  3. Lepus监控之SQLServer配置(后续整理)

    1.安装pymssql模块 1-1.环境准备: 1-1-1.unixODBC安装 yum install unixODBC unixODBC-devel -y 1-1-2.freetds安装下载 fr ...

  4. Java备份文件

    文件名后面补时间: public static void initFile(String sPath) { SimpleDateFormat df = new SimpleDateFormat(&qu ...

  5. java中随机二维数组中寻找最大值并输出坐标

    public static void main(String[] args) { int x=0; int y=0; int a[][]=new int[5][5]; int max=-Integer ...

  6. Oracle 循环查询

    select * from sys_department start with departmentid = '0303e461-2454-4d5a-bfea-2cd5a4c064c6' connec ...

  7. 用python探索和分析网络数据

    Edited by Markdown Refered from: John Ladd, Jessica Otis, Christopher N. Warren, and Scott Weingart, ...

  8. Mybatis-spring 动态代理

    1.UserMapper.java package com.cn.mapper; import java.util.List; import com.cn.pojo.User; public inte ...

  9. OpenCV代码:画出轮廓的外接矩形,和中心点

    #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include & ...

  10. 自动滚动标签marquee

    <marquee>标签,它是成对出现的标签,首标签<marquee>和尾标签</marquee>之间的内容就是滚动内容.<marquee>标签的属性主要 ...