title: Horizontal Family tree with CSS and HTML
body: <p>I've searched the web, found and later edited a good example of family tree here in codepen: <a href="https://gist.github.com/leolanchas/9887b4e68db9f5894c9c" rel="nofollow">http://codepen.io/anon/pen/bdLeNe</a>. My code is below.</p>
  
  <p>I am struggling with 2 (css) issues:</p>
  
  <ul>
  <li>1: I need to adapt the tree so in every parent link's end (where it intersects its children level) I can paint a circle, but the only thing I get is it paints the circle below the link.</li>
  </ul>
  
  <p>Something like this:</p>
  
  <pre><code>      ----- LN
        |
  P --- O
        |
        ----- LN
  </code></pre>
  
  <p>Where P is Parent and LN leaf node.</p>
  
  <ul>
  <li>2: In the original example leaf nodes have no content (p, inputs, and so on). If they have it inside any of these elements <code>&lt;span class="label"&gt;</code>, they overlap with its brothers. I do not know how to make them have variable height when they are relative positioned. I have tried with <code>margin-top</code> but then the problems is that the links are not high enough (nodes are disconnected)</li>
  </ul>
  
  <p>I created a gist: <a href="https://gist.github.com/leolanchas/9887b4e68db9f5894c9c" rel="nofollow">https://gist.github.com/leolanchas/9887b4e68db9f5894c9c</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>*, *:before, *:after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
  }
  
  body {
    min-width: 1200px;
    margin: 0;
    padding: 50px;
    color: #eee9dc;
    font: 16px Verdana, sans-serif;
    background: #2e6ba7;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  #wrapper {
    position: relative;
  }
  
  .branch {
    position: relative;
    margin-left: 250px;
  }
  .branch:before {
    content: '';
    font-size: 40px;
    width: 50px;
    border-top: 2px solid #eee9dc;
    position: absolute;
    left: -100px;
    top: 50%;
    margin-top: 1px;
  }
  
  .branch:after {
    content: '\25CF';
    font-size: 40px;
    position: absolute;
    left: -100px;
    top: 50%;
  }
  
  .entry {
    position: relative;
    min-height: 60px;
  }
  .entry:before {
    content: "";
    height: 100%;
    border-left: 2px solid #eee9dc;
    position: absolute;
    left: -50px;
  }
  .entry:after {
    content: "";
    width: 50px;
    border-top: 2px solid #eee9dc;
    position: absolute;
    left: -50px;
    top: 50%;
    margin-top: 1px;
  }
  .entry:first-child:before {
    width: 10px;
    height: 50%;
    top: 50%;
    margin-top: 2px;
    border-radius: 10px 0 0 0;
  }
  .entry:first-child:after {
    height: 10px;
    border-radius: 10px 0 0 0;
  }
  .entry:last-child:before {
    width: 10px;
    height: 50%;
    border-radius: 0 0 0 10px;
  }
  .entry:last-child:after {
    height: 10px;
    border-top: none;
    border-bottom: 2px solid #eee9dc;
    border-radius: 0 0 0 10px;
    margin-top: -9px;
  }
  .entry.sole:before {
    display: none;
  }
  .entry.sole:after {
    width: 50px;
    height: 0;
    margin-top: 1px;
    border-radius: 0;
  }
  
  .label {
    display: block;
    min-width: 150px;
    padding: 5px 10px;
    line-height: 20px;
    text-align: center;
    border: 2px solid #eee9dc;
    border-radius: 5px;
    position: absolute;
    left: 0;
    top: 50%;
    margin-top: -15px;
  }
  
  .label input {
    display: block;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://code.jquery.com/jquery-2.2.2.min.js" integrity="sha256-36cp2Co+/62rEAAYHLmRCPIych47CvdM+uTBJwSzWjI=" crossorigin="anonymous"&gt;&lt;/script&gt;
  &lt;div id="wrapper"&gt;
    &lt;span class="label"&gt;Root&lt;/span&gt;
    &lt;div class="branch lv1"&gt;
      &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-1&lt;/span&gt;
        &lt;div class="branch lv2"&gt;
          &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-1-1&lt;/span&gt;
            &lt;div class="branch lv3"&gt;
              &lt;div class="entry sole"&gt;&lt;span class="label"&gt;Entry-1-1-1&lt;/span&gt;&lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-1-2&lt;/span&gt;
            &lt;div class="branch lv3"&gt;
              &lt;div class="entry sole"&gt;&lt;span class="label"&gt;Entry-1-2-1&lt;/span&gt;&lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-1-3&lt;/span&gt;
            &lt;div class="branch lv3"&gt;
              &lt;div class="entry sole"&gt;&lt;span class="label"&gt;Entry-1-3-1&lt;/span&gt;&lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-2&lt;/span&gt;&lt;/div&gt;
      &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3&lt;/span&gt;
        &lt;div class="branch lv2"&gt;
          &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-1&lt;/span&gt;&lt;/div&gt;
          &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-2&lt;/span&gt;&lt;/div&gt;
          &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3&lt;/span&gt;
            &lt;div class="branch lv3"&gt;
              &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3-1&lt;/span&gt;
                &lt;div class="branch lv3"&gt;
                  &lt;div class="entry"&gt;
                    &lt;span class="label"&gt;
                      &lt;input type="text" disabled="" value="Entry-3-3-1-1"&gt;
  
                      &lt;input type="text" disabled="" value="Entry-3-3-1-1"&gt;
  
                      &lt;input type="number"&gt;&lt;/input&gt;
                    &lt;/span&gt;
                &lt;/div&gt;
                &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3-1-2&lt;/span&gt;&lt;/div&gt;
                &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3-1-3&lt;/span&gt;&lt;/div&gt;
                &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3-1-4&lt;/span&gt;&lt;/div&gt;
                &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3-1-5&lt;/span&gt;&lt;/div&gt;
                &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3-1-6&lt;/span&gt;&lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3-2&lt;/span&gt;
              &lt;div class="branch lv4"&gt;
                &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3-2-1&lt;/span&gt;&lt;/div&gt;
                &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3-2-2&lt;/span&gt;&lt;/div&gt;
                &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3-2-3&lt;/span&gt;&lt;/div&gt;
                &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3-2-4&lt;/span&gt;&lt;/div&gt;
                &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3-2-5&lt;/span&gt;&lt;/div&gt;
                &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3-2-6&lt;/span&gt;&lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-3-3&lt;/span&gt;&lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-3-4&lt;/span&gt;&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-4&lt;/span&gt;&lt;/div&gt;
    &lt;div class="entry"&gt;&lt;span class="label"&gt;Entry-5&lt;/span&gt;&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>