How to make dynamic width of div containing ul/li?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PandaPanda
    New Member
    • Sep 2014
    • 3

    How to make dynamic width of div containing ul/li?

    I created a dynamic organizational chart using the css3-family-tree code.


    The issue is, if the width of the chart gets larger than the browser window, it gets messed up by staying the same size as the windows and scrambling the structure instead of extending the flow of the window with a scroll bar. fiddle: http://jsfiddle.net/euwx9qvq/

    What I'm trying to do is to get the DIV to be the right size dynamically without hard coding a width in the CSS and have the scroll bar scroll to the exact size and not more.
  • PandaPanda
    New Member
    • Sep 2014
    • 3

    #2
    I was able to fix it by adding this to the li of the tree

    Code:
    display: inline-block;
    white-space: nowrap;
    vertical-align: top;
    margin: 0 -2px 0 -2px;
    text-align: center;

    Comment

    Working...