纯CSS 实现组织架构图,学习

先上张图

 

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>

转载于:https://www.cnblogs.com/aibo/archive/2011/10/04/2199158.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值