css之absolute绝对定位(绝对定位特性)
学习了绝对定位以后,对此进行一个总结,啦啦啦啦~
绝对定位特性
1、破坏性
破坏了原有的位置,从文档流里脱离出来
2、包裹性
如果下面这种情况,父级元素将不会有高度和宽度,失去原有的大小
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAAB1CAIAAAAJA342AAAHMklEQVR4nO3ZW0xTdxzAcZ9N8KFP28uWmT1tQR+WbU8sS0x0y8YWnZtxUaeByuKAoE4y2RoPZ7OrbdNSag8V2tLLqdwvLRd7PIWWs244AhPwEgKuMxZQLj2E0rE2vfz3cExD5qiFXar+f798H0hTaPv7nPPvA1sQTFZnS7bfAO4DAFmehwDmUg2UCgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAAO8AAADwDgAAYIOpvvs+61vDF4AgCIQ4giCyvjgcAYTtCz0zBk8NwNrtP0sGWQDYxDy6/ZTBv/j+nvnZJMB62weDjc5mANJvHww2NA8BLBYjkdlYLPrHbl/IbKYy/Js4jMViTAdAZHBRQ/8kYp0jAQAAAI8A4CkHiK70Owprrtc3ZP2TPKVtBuCez+khTP8QYHn5it0uycvbQZIFqQdHRgy7dr2Wk7O1pOSjYLAbIW51lZVKj4tE23Jzt7tcymRy4P/Zy9ycQ6sty83dTtMS4ZFkcsDlUubmbheJtkmlx1dXWYS4YLC7pOSjnJytu3a9NjJiyALApqNpicn0lV5/OgUwN+c4cmTP+Hh9IuG12b5RqYqTyQGalpBkQSTinp5uKyh4z+9v/B+2H497FIoT3d0Xzp49lAKYmKAPHdodCLRGIm6p9Hhb27fxuEcqPW42VyQS3hs3zGJxPs/3/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pKSHw8c+Nrt7kKI9ngMmZk72touBIOWhw8V6elbx8ZaYvHodHUI0aOj6srKEuYxMzKiFol4Tme3Uins6ZHEOv7JSf38fB9CtN9vjvp8Yrp4FG63QSTivXihX1gwq1Q1zGMmELAolUKDQTIyohYKuU7nm4t7CZ6g32IXKbifsJW7K/5obGZ4BmXNzEcDpuM2DbPy9Iihda9gSNUW63AZGFZEbDahy6Xdtu1LFouVkrKhvf2C39/PnOXz5zOSktampGy4ebMqDBP+w40bP2NO9Fs8CNEDA5Jdu7YwG+zr44dC1vAumGRnp3q9Rr1ezHztWFJyaWBAyVzCNTWlN27I0euny6NHHfGvs/hdPAq328DlFlEUxWYXNjZWMBOj3d4kEnFnZ40I0Wp1rVz+5sb9/35rEDm5rVojJ7dECjzAA11ugQfrRudJ/L+lkH81kT/ofK9f6nzIxSPAAzwkFo8AD/CQWDwCPMBDYvEI8AAPicUjwAM8JBaPAA/wkFg8AjzAQ2LxCPAAD4nFI8ADPCQWjwAP8JBYPAI8wENi8QjwAA+JxSPAAzwkFo8AD/CQWDwCPMBDYvEI8AAPicUjwAM8JBaPAA/wkFg8AjzAQ2LxCPAAD4nFI8ADPCQWjwAP8JBYPAI8wENi8QjwAA+JxSPAAzwkFo8AD/CQWDwCPMBDYvEI8AAPicUjwAM8JBaPAA/wkFg8AjzAQ2LxCPAAD4nFI8ADPCQWjwAPKTwQ/AI8WOdv/POdwykXO/sAAAAASUVORK5CYII=" alt="" />
<div>
<div style="width: 100px;height: 100px;position: absolute;background:red;"></div>
</div>
3、去浮动
设置绝对定位以后,浮动的元素将会失效,来看下面的效果
b {
display: inline-block;
float: right;
width: 18px;
height: 30px;
background: url(../images/icon.png) no-repeat;
background-position: -154px -42px;
}
效果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqsAAAApCAIAAACdnvdcAAAFVElEQVR4nO3dv4/mRh3Hcf8TeZRrVkJBD8qRB6V5JBRlqJ7SDcKdJYRiOhcg/wnTjYSAh86dBQUGG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AiebZVSSq1XK5VXxhhjTJWnVe9FxDX52SpJktW66EaRYwFhKUGMbWksqwIAAPF6+vTh/bcevew+ABERV+/W27xxIq5JV+vtMouftVMsGEymW+v7eS2Aa/K8cSLWqKoPcnVF4fUbuT454JrSWN9Xu2Lf2jGcLq6q4asHAQAgMq9oLYCIWJPVzveVuvaVHrFmu0wNTAadNmOwJtNDkDBotXzFZ6jUsXIfDvWUD44JwHdlfnNhYBh7k6u9FXH1bhrmeKWxLevnfpEIAIAYvKIEEAadzr34rsmnwvyRH/T29Bp/+iJQONT57tjCZ/Vmnjk4NMUu3du57++wXzKCtybdTQ0E3nUmU5luD15k7E6xw5pNNYiI9NWGxYEAgHhdnl88evO7j95592UmAN8WeXur8c7VKpnn8/P9aU5+SQBjk+f1IYhr0qmPL9vbIMGatGiWNoEkSZKVKq8ECm9NWrR/NtlcDxjbIi2n40VEJNh9vj1LkrNtTgkAABCzED764Y8+/vFPXu7/BQAAAP9zLi/v+vgXEgAAAHEiAQAAECMSAAAAMSIBAAAQIxIAAAAxIgEAABAjEgAAADEiAQAAECMSAAAAMSIBAAAQIxIAAAAxupkAAABAJE4JAAAAxIYEAABAjP4NXelJkAA7lRkAAAAASUVORK5CYII=" alt="" />
加上position:absolute以后
b {
position: absolute;
display: inline-block;
float: right;
width: 18px;
height: 30px;
background: url(../images/icon.png) no-repeat;
background-position: -154px -42px;
}
效果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqUAAAAnCAIAAAC5XaafAAAFWElEQVR4nO3dsY/0RhnHcf8TWeVtTkJBi/KSRWlWQlGGaks3CHeWEIrpXID2T5huJAQsnTsLCgw0FhQuLWim245R3vdNhiRvRgl3moj3zT31S2F7d+9uE12iIHjN96PV6WR5x3vb/GaeZ+xLXrx44b0XAAAwXwl5DwDA7JH3AADMH3kPAMD8kfcAAMwfeQ8AwPyR9wAAzB95DwDA/JH3AADMH3kPAMD8kfcAAMzfvPL+s88+euenT3/2c7m+/m9/FAAA/ofcK+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iGAMT5JBsVRfWvb38pIkCEMQYRYz4PFkRMqAiIyRxA2KpdrCRX9n156b5diSITAAIo5j0zr5nS+E5bIMhzDmbJaEUwbTG6PIOifjMYj4Pwy9VMWngAKAUiCaWZxH7KyRUjpbz9c/XgacFm02u6YAAAAASUVORK5CYII=" alt="" />跑到购物系统的后面,而不是在,左上角,如果设置了left,top等的值,aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAARCAIAAACNaGH2AAAB9ElEQVQokW2Sz2pTQRTG70ootqZVca1StKTUnfgGgoIPIfgCijaI0q7FRduk+gDiSl9CEt2EljRgEizElMTcaPDmzsz5zpl78+eOi5sGUnsWM8Ocb76Z4ft5zMzMSEeARXgYs7VAujdX3nQG0ja0Nr6PwYBFAPD8GW+qJCIimUzUweHx3Xt/PnwU50gpJppTE4GZCYAxnCRBsfT9woK/s2uTBGF41ns4FKM0aU1K8WgUfCnWM5f9vbyMxxQE0BrGTB8JeMORJbYcRbBWnAvL5dpipvfufeQcAIkjieP0Y8zsmVCpRiOoVILKUfjjuP/pc+3SSmdrO2w2g4PD4KgaVKsm+Dv17tcavfsPOjdW29mNTnajtXq7fuVa8/rNX+t32mvZ9tp6+1Y2KJXYWiLy5KTVe/PWf/qsm3vpv3rdefyktnL158NHva3t7vPN7mau+yKn6g0WISLPTawmEDMB7NygXK4tZvzCvjhHWkMEIrNAPBJJswQgzg2+fqsvLfcK+9Y5aM3MfKpmZq/vnFWaiGAMT5JBsVRfWvb38pIkCEMQYRYz4PFkRMqAiIyRxA2KpdrCRX9n156b5diSITAAIo5j0zr5nS+E5bIMhzDmbJaEUwbTG6PIOifjMYj4Pwy9VMWngAKAUiCaWZxH7KyRUjpbz9c/XgacFm02u6YAAAAASUVORK5CYII=" alt="" />加号的位置就会发生改变了
css之absolute绝对定位(绝对定位特性)的更多相关文章
- css定位:相对定位、绝对定位、固定定位的区别与特性
css定位:相对定位.绝对定位.固定定位的区别与特性 原文地址:http://www.qingzhouquanzi.com/106.html css定位常用的有以下三种: 使用了定位的共同特性: 这三 ...
- 详解CSS的相对定位和绝对定位
CSS的相对定位和绝对定位通常情况下,我们元素的position属性的值默认为static 就是没有定位,元素出现在正常的文档流中,,这个时候你给这个元素设置的left,right,bottom,to ...
- 每天学点前端——基础篇1:css盒子模型,绝对定位和相对定位
什么是css盒子模型(Box Model)? W3C中解释为:规定了元素框处理元素内容.内边距.边框和外边距的方式: MDN:文档中的每个元素被描绘为矩形盒子.渲染引擎的目的就是判定大小,属性--比如 ...
- HTML 学习笔记 CSS样式(相对定位 绝对定位)
CSS相对定位 设置为相对定位(relative)的元素会偏移某个距离.元素仍保持其未定位前的形状,他原本所占的空间仍然保留 CSS相对定位 相对定位是一个非常容易掌握的概念,如果对一个元素进行相对定 ...
- CSS定位深入理解 完全掌握CSS定位 相对定位和绝对定位
其实前面的标准流和浮动流都很理解,就是定位不太好理解,特别是相对定位和绝对定位,很多刚开始学的同学不好区分.因此这里,小强老师和大家一起分享CSS定位的学习. 通过我们前面的学习,我们网页布局方法: ...
- Web—12-详解CSS的相对定位和绝对定位
CSS的相对定位和绝对定位通常情况下,我们元素的position属性的值默认为static 就是没有定位,元素出现在正常的文档流中,,这个时候你给这个元素设置的left,right,bottom,to ...
- 详解CSS的相对定位和绝对定位(讲得很详细)
详解CSS的相对定位和绝对定位 CSS的相对定位和绝对定位通常情况下,我们元素的position属性的值默认为static 就是没有定位,元素出现在正常的文档流中,,这个时候你给这个元素设置的left ...
- css布局模型之绝对定位与相对定位
1. 绝对定位,absolute 如果想为元素设置层模型中的绝对定位,需要设置position:absolute(表示绝对定位),这条语句的作用将元素从文档流中拖出来,然后使用left.right.t ...
- Absolute(绝对定位)与relative(相对定位)的图文讲解
Position的属性值有:1. Absolute:绝对定位,是相对于最近的且不是static定位的父元素来定位 2. Fixed:绝对定位,是相对于浏览器窗口来定位的,是固定的,不会 ...
- css position: absolute、relative详解
CSS2.0 HandBook上的解释: 设置此属性值为 absolute 会将对象拖离出正常的文档流绝对定位而不考虑它周围内容的布局.假如其他具有不同 z-index 属性的对象已经占据了给定的位置 ...
随机推荐
- 许小年:宁可踏空,不可断粮<转>
http://www.daonong.com/g/25/xsqy/2014/0716/51074.html 文│许小年 中欧国际工商学院教授 为什么我们企业的创新能力长期处于低水平呢? 深入观察,内心 ...
- 洛谷P3370 【模板】字符串哈希
P3370 [模板]字符串哈希 143通过 483提交 题目提供者HansBug 标签 难度普及- 提交 讨论 题解 最新讨论 看不出来,这题哪里是哈希了- 题目描述 如题,给定N个字符串(第i个 ...
- Mongodb集群搭建过程及常见错误
Replica Sets MongoDB 支持在多个机器中通过异步复制达到故障转移和实现冗余.多机器中同一时刻只 有一台是用于写操作.正是由于这个情况,为 MongoDB 提供了数据一致性的保障.担当 ...
- Linux Runlevel 启动 脚本
Linux 操作系统自从开始启动至启动完毕需要经历几个不同的阶段,这几个阶段就叫做 Runlevel,同样,当Linux操作系统关闭时也要经历另外几个不同的 Runlevel,下面详细介绍一下 Run ...
- The source attachment does not contain the source for the file ActionSupport.class 错误
报错 Syntax error, insert ";" to complete FieldDeclaration 报错 The source attachment does ...
- 怎样去除SVN中的某个版本之前的所有版本
地狱门神 在某些时候,我们可能需要一个存放二进制文件的SVN库,用来保存每日构建的结果等.但是这种库会趋于越来越大,最后会占用很多磁盘空间.这时我们会想到能不能删掉某个版本之前的所有版本,以节省磁盘空 ...
- Python使用MySQLdb报Library not loaded: libmysqlclient.18.dylib错误
Library not loaded: libmysqlclient.18.dylib就是找不到这个文件,首先要确定是否有这个文件 可以使用find命令,确认位置后可以使用如下两种方法:1.制作软连接 ...
- python使用代理ip发送http请求
一.需求背景 网站刷票时,经常会遇到限制一个ip只能投票一次的限制,为此需要使用代理ip 二.脚本如下: 1.Proxy_http.py使用代理ip发送httpr的get和post请求 #coding ...
- OPTIMIZE TABLE 小解
首先看一下语法: OPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [, tbl_name] ... 我们知道mysql存储引擎里面的数据和索 ...
- python Tornado(招聘的一个比较经常问到的知识)
Tornado既是一个webserver也是一个web框架 这是一个总结的比较详细的内容 http://www.nowamagic.net/academy/detail/1332612 开源中国中的关 ...