heml5第七课时,绝对定位(absolute)
来源:互联网 发布:办公室软件培训心得 编辑:程序博客网 时间:2024/06/17 06:16
<!DOCTYPE html><html><head lang="en"> <meta charset="UTF-8"> <title>绝对定位(absolute)</title> <style> #child1,#child2,#child3{ float: left; } #child1{ width: 200px; height: 200px; background-color: #4d2e83; } #child2{ width: 200px; background-color: #585858; height: 200px; position: absolute;/*写了absolute(绝对定位),top和left才可以用*/ top: 100px; left: 30px; } #child3{ width: 200px; height: 200px; background-color: #ff6600; } #parent3{ background-color: #19242C; width: 1000px; height: 500px; position: relative; top: 100px; left: 100px; } #parent2{ width: 88%; height: 88%; background-color: #42668f; } #parent1{ width: 88%; height: 88%; background-color: yellow; } </style></head><!--采用绝对定位的元素,会寻找离他最近的采用了定位的父元素,并以它为坐标进行定位 如果所有的父元素都没有使用定位,则以body为坐标进行定位, 并且元素占用的空间会被其他元素占用,即原本child2的位置,会被饿child3占用。--><body><div id="parent3"> <div id="parent2"> <div id="parent1"> <div id="child1"></div> <div id="child2"></div> <div id="child3"></div> </div> </div></div></body></html>
0 0
- heml5第七课时,绝对定位(absolute)
- heml5第七课时,相对定位
- H5基础知识第七课时(CSS定位)
- CSS盒子的绝对(absolute)定位
- 绝对定位Position:absolute
- absolute绝对定位
- css的绝对定位(absolute)、相对定位(relative)
- 绝对定位(absolute)与相对定位(relative)学习心得
- CSS绝对定位(absolute)与相对定位(relative)
- html5第七课时,固定定位
- 绝对定位absolute的好处
- HTML之绝对定位Absolute
- CSS的绝对定位absolute
- positon:absolute; 复习绝对定位
- position:absolute绝对定位居中
- IE6/7下绝对定位(position:absolute)元素消失
- CSS 相对|绝对(relative/absolute)定位系列(一)
- CSS 相对/绝对(relative/absolute)定位系列(二)
- phpcms 2008 sp4的模板原理,tag的解析原理
- 多平台开发 JavaScript 接入ios原生 inMobi 广告
- Weex 报 throw new Error('resolve path error:'+this.path) 的解决办法
- 【JavaEE】Introduce of "JSF's faces-config.xml"
- 源码解析-集合-ArrayList
- heml5第七课时,绝对定位(absolute)
- 大数据-Hadoop学习笔记10
- 3种数据库的xml模糊查询
- static作用
- 源码解析-集合-HashSet
- 正则表达式匹配
- Linux开发--探讨将标准输入输出及错误重定向到/dev/null
- 知识快速积累可复制方法,过程
- 源码解析-集合-LinkedList