zoukankan      html  css  js  c++  java
  • 纯CSS 实现组织架构图,学习

    先上张图

    Css 代码如下:


    div#contain {
     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;
      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;
      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>

  • 相关阅读:
    Three.js中引入dat.gui库实现界面组件控制动画速度变量
    Three.js中使用requestAnimationFrame方法实现立方体转动和小球跳动的动画
    Windows下使用Java API操作HDFS的常用方法
    Windows下配置Hadoop的Java开发环境以及用Java API操作HDFS
    HDFS的访问方式之HDFS shell的常用命令
    CentOS7上搭建Hadoop集群(入门级)
    CentOS7中怎样安装JDK与配置环境变量
    【2021-08-05】哪怕天踏下来,也要当被子盖
    【2021-08-04】连岳摘抄
    【2021-08-03】里程碑
  • 原文地址:https://www.cnblogs.com/aibo/p/2199158.html
Copyright © 2011-2022 走看看