纯CSS 实现组织架构图,学习
2011-10-04 22:36
134 查看
先上张图
Css 代码如下:
div#contain {
width:1000em;
background:#fff;
font-family:verdan;
}
ul#xflow {
float: none;
margin: 0 auto;
}
ul {
clear: left;
margin: 2em 0 0 0;
padding: 0;
background: #fff;
}
ul ul {
border-top: 1px solid #000;
width: auto;
}
ul.solo {
border-top: 0;
}
li {
float: left;
list-style: none;
position: relative;
}
li li {
margin: -1px 0 0 0;
}
#xflow div{
background: url(../img/Flow/vLine.gif) 50% repeat-y;
padding: 2em 5px 0 5px;
margin: 0 .3em -2em 0em;
}
#xflow div.section {
padding: 2em 5px 2em 5px;
}
#xflow div.first {
background: url(../img/Flow/first.gif) 50% repeat-y;
margin-left: 0;
}
#xflow div.last {
background: url(../img/Flow/last.gif) 50% repeat-y;
margin-right:0;
}
.none{border:0px;}
#xflow div.root {
padding-top: 0;
}
#xflow a {
display: block;
background: #fff;
border: 1px solid #000;
padding: .25em .2em .2em .2em;
color: #222;
text-decoration: none;
margin: 0 auto;
width: 10em;
line-height: 2em;
text-align: center;
}
/*IE 6 (when comma-separated, IE6 didn't work, so these are duped for IE7)*/
*html {text-align: center;}
*html a {margin: 0; position: relative;}
/*IE 7*/
*:first-child+html {text-align: center;}
*:first-child+html a {margin: 0; position: relative;}
Html 结构:
<div id="contain">
<ul class="solo" id="xflow">
<li>
<div class='root section'>
<a>总经理</a></div>
<ul class="">
<li>
<div class='first'>
<a>财务总监</a></div>
</li>
<li>
<div class=''>
<a>人力资源总监</a></div>
</li>
<li>
<div class=' section'>
<a>营销总监</a></div>
<ul class="none">
<li>
<div class=' section'>
<a>营销经理</a></div>
<ul class="none">
<li>
<div class=''>
<a>营销助理</a></div>
</li>
</ul>
</li>
</ul>
</li>
<li>
<div class=' section'>
<a>产品总监</a></div>
<ul class="">
<li>
<div class='first'>
<a>经理</a></div>
</li>
<li>
<div class='last'>
<a>经理</a></div>
</li>
</ul>
</li>
<li>
<div class='last'>
<a>研发总监</a></div>
</li>
</ul>
</li>
</ul>
</div>
Css 代码如下:
div#contain {
width:1000em;
background:#fff;
font-family:verdan;
}
ul#xflow {
float: none;
margin: 0 auto;
}
ul {
clear: left;
margin: 2em 0 0 0;
padding: 0;
background: #fff;
}
ul ul {
border-top: 1px solid #000;
width: auto;
}
ul.solo {
border-top: 0;
}
li {
float: left;
list-style: none;
position: relative;
}
li li {
margin: -1px 0 0 0;
}
#xflow div{
background: url(../img/Flow/vLine.gif) 50% repeat-y;
padding: 2em 5px 0 5px;
margin: 0 .3em -2em 0em;
}
#xflow div.section {
padding: 2em 5px 2em 5px;
}
#xflow div.first {
background: url(../img/Flow/first.gif) 50% repeat-y;
margin-left: 0;
}
#xflow div.last {
background: url(../img/Flow/last.gif) 50% repeat-y;
margin-right:0;
}
.none{border:0px;}
#xflow div.root {
padding-top: 0;
}
#xflow a {
display: block;
background: #fff;
border: 1px solid #000;
padding: .25em .2em .2em .2em;
color: #222;
text-decoration: none;
margin: 0 auto;
width: 10em;
line-height: 2em;
text-align: center;
}
/*IE 6 (when comma-separated, IE6 didn't work, so these are duped for IE7)*/
*html {text-align: center;}
*html a {margin: 0; position: relative;}
/*IE 7*/
*:first-child+html {text-align: center;}
*:first-child+html a {margin: 0; position: relative;}
Html 结构:
<div id="contain">
<ul class="solo" id="xflow">
<li>
<div class='root section'>
<a>总经理</a></div>
<ul class="">
<li>
<div class='first'>
<a>财务总监</a></div>
</li>
<li>
<div class=''>
<a>人力资源总监</a></div>
</li>
<li>
<div class=' section'>
<a>营销总监</a></div>
<ul class="none">
<li>
<div class=' section'>
<a>营销经理</a></div>
<ul class="none">
<li>
<div class=''>
<a>营销助理</a></div>
</li>
</ul>
</li>
</ul>
</li>
<li>
<div class=' section'>
<a>产品总监</a></div>
<ul class="">
<li>
<div class='first'>
<a>经理</a></div>
</li>
<li>
<div class='last'>
<a>经理</a></div>
</li>
</ul>
</li>
<li>
<div class='last'>
<a>研发总监</a></div>
</li>
</ul>
</li>
</ul>
</div>
相关文章推荐
- 纯CSS实现家谱树(组织架构树同理)
- 转:【CSS/JS学习】如何实现单行/多行文本溢出的省略(...)--老司机绕过坑道的正确姿势
- html和css实现一级菜单和二级菜单学习笔记
- HTML5学习_day10(1)--css编码风格和WEB标准架构
- 基于Spring Boot和Spring Cloud实现微服务架构学习(一)-Spring框架介绍
- 黑马程序员 C#学习笔记⑥ 三层架构基础实现员工信息管理
- MySQL实现递归调用,查询组织架构树
- Atitit jOrgChart的使用 组织架构图css html
- CSS学习笔记----页面居中实现
- 纯CSS+DIV实现的竖向菜单(简单例子,提供学CSS的朋友学习)
- html css学习笔记-响应式布局的两种基本实现
- 基于Spring Boot和Spring Cloud实现微服务架构学习(六)-Docker应用
- Hbase 学习笔记(四): Hbase的架构和实现原理
- MySQL实现递归调用,查询组织架构树
- 基于Spring Boot和Spring Cloud实现微服务架构学习(四)-Spring Cloud总结
- 基于Spring Boot和Spring Cloud实现微服务架构学习
- 小米云深度学习平台的架构设计与实现
- 10 大深度学习架构:计算机视觉优秀从业者必备(附代码实现)
- 阿里带你一起学习企业运维监控平台架构设计与实现
- JSP实现树型组织架构(1)--需求分析和数据库