Responsive flow diagram

Responsive HTML CSS only flow diagram

by Ayyappan Sakthivadivel

HTML

<div class="content">
  <h1>Responsive Organization Chart</h1>
  <figure class="org-chart cf">
    <ul class="administration">
      <li>					
        <ul class="director">
          <li>
            <a href="#"><span>Director</span></a>
            <ul class="subdirector">
              <li><a href="#"><span>Assistante Director</span></a></li>
            </ul>
            <ul class="departments cf">								
              <li><a href="#"><span>Administration</span></a></li>
              
              <li class="department dep-a">
                <a href="#"><span>Department A</span></a>
                <ul class="sections">
                  <li class="section"><a href="#"><span>Section A1</span></a></li>
                  <li class="section"><a href="#"><span>Section A2</span></a></li>
                  <li class="section"><a href="#"><span>Section A3</span></a></li>
                  <li class="section"><a href="#"><span>Section A4</span></a></li>
                  <li class="section"><a href="#"><span>Section A5</span></a></li>
                </ul>
              </li>
              <li class="department dep-b">
                <a href="#"><span>Department B</span></a>
                <ul class="sections">
                  <li class="section"><a href="#"><span>Section B1</span></a></li>
                  <li class="section"><a href="#"><span>Section B2</span></a></li>
                  <li class="section"><a href="#"><span>Section B3</span></a></li>
                  <li class="section"><a href="#"><span>Section B4</span></a></li>
                </ul>
              </li>
              <li class="department dep-c">
                <a href="#"><span>Department C</span></a>
                <ul class="sections">
                  <li class="section"><a href="#"><span>Section C1</span></a></li>
                  <li class="section"><a href="#"><span>Section C2</span></a></li>
                  <li class="section"><a href="#"><span>Section C3</span></a></li>
  ...

CSS

*{
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
	position: relative;
}

.cf:before,
.cf:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.cf:after {
    clear: both;
}

/**
 * For IE 6/7 only
 * Include this rule to trigger hasLayout and contain floats.
 */
.cf {
    *zoom: 1;
}

/* Generic styling */

body{
	background: #F5EEC9;	
}

.content{
	width: 100%;
	max-width: 1142px;
	margin: 0 auto;
	padding: 0 20px;
}

a:focus{
	outline: 2px dashed #f7f7f7;
}

@media all and (max-width: 767px){
	.content{
		padding: 0 20px;
	}	
}

ul{
	padding: 0;
	margin: 0;
	list-style: none;		
}

ul a{
	display: block;
	background: #ccc;
	border: 4px solid #fff;
	text-align: center;
	overflow: hidden;
	font-size: .7em;
	text-decoration: none;
	font-weight: bold;
	color: #333;
	height: 70px;
	margin-bottom: -26px;
	box-shadow: 4px 4px 9px -4px rgba(0,0,0,0.4);
	-webkit-transition: all linear .1s;
	-moz-transition: all linear .1s;
	transition: all linear .1s;
}


@media all and (max-width: 767px){
	ul a{
		font-size: 1em;
	}
}


ul a span{
	top: 50%;
	margin-top: -0.7em;
	display: block;
}

/*
 
 */

.administration > li > a{
	margin-bottom: 25px;
}

.director > li > a{
	width: 50%;
	margin: 0 auto 0px auto;
}

.subdirector:after{
	content: "";
	display: block;
	width: 0;
	height: 130px;
	background: red;
	border-left: 4px solid #fff;
	left: 45.45%;
	position: relative;
}

.subdirector,
.departments{
	position: absolute;
	width: 100%;
}

.subdirector > li:first-child,
.departments > li:first-child{	
	width: 18.59894921190893%;
	height: 64px;
	margin: 0 auto 92px auto;		
	padding-top: 25px;
	border-bottom: 4px solid white;
	z-index: 1;	
}

.subdirector > li:first-child{
	float: right;
	right: 27.2%;
	border-left: 4px solid white;
}

.departments > li:first-child{	
	float: left;
	left: 27.2%;
	border-right: 4px solid white;	
}

.subdirector > li:first-child a,
.departments > li:first-child a{
	width: 100%;
}

.subdirector >...