float定位点分析
来源:互联网 发布:worktile基础版 mac 编辑:程序博客网 时间:2024/05/21 09:46
之前有个概念认为float就是完全在最上端单独显示,脱离了文档流,不考虑位置
但是实际上float依然受父元素的约束,只是显示在上不占文档流而已
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>my1</title><style>#container{width: 1008px;background: yellow;}#header{height: 120px;background: orange;}#main{height: 400px;background: green;margin-top: 20px;margin-left: 20px;margin-right: 20px;z-index: 20;}#lside{width: 300px;z-index: 0;height: 500px;background: pink;float: right;}#rside{width: 300px;height: 250px;background: purple;position: fixed;left: 200px;}#footer{height: 220px;background: blue;}</style></head><body><div id="container"><div id="header"><h1>This is main</h1><p>This is a main.</p></div><div id="main"><div id="lside"><script>document.write("<h1>This is a heading</h1>");document.write("<p>This is a paragraph.</p>");</script><input id="i1" type="text"><button id="b2" type="button" onclick="pdnum()">Submit</button></div><div id="rside">this is right side<button type="button" onclick="changeh1()">点击这里</button></div></div><div id="footer"> this is footer</div></div> <script src="./js/t1.js" type="text/javascript"></script></body></html>
这个例子里面rside只能在main里面动
0 0
- float定位点分析
- float定位
- 定位(二) float
- CSS+DIV float 定位
- 深入理解浮动定位(float)
- css 浮动定位float详解
- relative absolute float 定位总结
- Float浮动和position定位
- CSS 浮动(float)注意点
- C中的Float分析
- float精度分析
- 【转】float精度分析
- C 中float分析
- C中的Float分析
- float精度分析
- 什么时候用float,什么时候用定位?
- 初学css+div问题,float定位问题
- 利用float clear 定位,下拉菜单演示
- Harris角点检测
- 我的搬瓦工
- c plus plus 第3章练习
- 第一章导言的笔记与思考
- 《Linux内核分析》(七)——Linux可执行程序浅析
- float定位点分析
- BNU 33561 Cantonese Dialect
- Prerequisite Check "CheckRollbackable" On Auto-rollback Patches Failed (文档 ID 1331900.1)
- 把文件存放在SDCard中
- 1-100之间的所有素数
- Asp身份验证的3种方式
- c++ Lambda表达式简介
- [BZOJ2480]SDOI2012 Longge的问题|欧拉函数
- CSS制作斜角上有背景图片的Div层