惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
博客园 - Franky
GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
C
CERT Recently Published Vulnerability Notes
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
L
LangChain Blog
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
AI
AI
T
Troy Hunt's Blog
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
S
Secure Thoughts
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Security @ Cisco Blogs
Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
Attack and Defense Labs
Attack and Defense Labs

博客园 - Richinger

纪念我的二姐 Myeclipse8.5快速注册 C#字符串数组的奇怪现象 - Richinger - 博客园 中国建设银行乐当家理财卡权益积分计算方法 ASP.NET网页之间复杂参数传递方法 - Richinger - 博客园 iis6.0添加asp.net 3.5网站 出现“HTTP 错误 404 - 文件或目录未找到”的解决办法 net2003 "visual studio.net 无法加载,因为无法加载MSXML3.DLL文件"的解决办法 民革九江第一支部星子活动纪实 使用oledb读写excel出现“操作必须使用一个可更新的查询”的解决办法 找不到可安装的ISAM - Richinger - 博客园 网站根目录下没有正确的DNT.config文件 解决办法 - Richinger - 博客园 HTTP 500 - 内部服务器错误 解决办法 中国建设银行国际结算业务介绍 高端客户业务 中国建设银行总行招聘信息技术及有关人员 LOGO1_.exe病毒及清理 九江名称的来历 asp.net也可以这样调用js 中国建设银行招聘公告
DIV+css定位 - Richinger - 博客园
Richinger · 2009-12-03 · via 博客园 - Richinger

请大家看看如下的定义及排出的结果:

代码

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
<style>
#container 
{margin:0 auto; width:100%;background:#ff0000;}
#div1 
{ height:300px; width:100px; background:#9c6; margin-bottom:0px;}
#div2 
{ height:100px; width:100px; background:#0c6; margin-left:100px; margin-top:-300px;}

#div3 

{ height:50px; width:80px; background:#009c60;margin-left:100px; margin-top:}
#div4 
{ height:100px; width:100px; background:#00c600;margin-left:100px;  }

#div5 

{ height:100px; width:200px; background:#c6ff00;margin-left:200px; margin-top:-250px; }

#div6 

{ height:200px; width:100px; background:#ffc600;margin-left:100px;margin-top:150px;  }
#div8 
{ height:200px; width:100px; background:#ff00ff;margin-left:300px; margin-top:-350px;}
#div7 
{ height:200px; width:100px; background:#ffc600;margin-left:400px;margin-top:-300px;}

#header 

{ height:100px; background:#9c6; margin-bottom:0px;}
#menu 
{ height:20px; background:#693; margin-bottom:0px;}
#mainContent 
{ background:url(bg.gif) 0 0 repeat-y; overflow:auto;zoom:1; margin-bottom:1px;}
#sidebar 
{ float:left; width:200px;background:#cf9; height:auto !important; height:100px;}
#content 
{ margin-left:205px !important; margin-left:202px; height:auto !important; height:100px; background:#ffa;}
#footer 
{ height:60px; background:#9c6;}
.clearfloat 
{ clear:both; height:0; font-size: 1px; line-height: 0px;}</style>
</head><body>
<div id="container" >
<div id="div1">div1</div>
<div id="div2">div2</div>
<div id="div3">div3</div>
<div id="div4">div4</div>
<div id="div5">div5</div>
<div id="div6">div6</div>
<div id="div8">div8</div>
<div id="div7">div7</div></div>
<div style="position: absolute; width: 100px; height: 100px; z-index: 1; left: 379px; top: 245px" id="layer1">
 
</div>
</body></html>

   特别注意div1-8在container中出现的先后次序再对照定义,或许会有些感悟。