473,412 Members | 4,594 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

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

I created a dynamic organizational chart using the css3-family-tree code.
http://thecodeplayer.com/walkthrough/css3-family-tree

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.
Sep 16 '14 #1

✓ answered by PandaPanda

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

Expand|Select|Wrap|Line Numbers
  1. display: inline-block;
  2. white-space: nowrap;
  3. vertical-align: top;
  4. margin: 0 -2px 0 -2px;
  5. text-align: center;

1 4383
I was able to fix it by adding this to the li of the tree

Expand|Select|Wrap|Line Numbers
  1. display: inline-block;
  2. white-space: nowrap;
  3. vertical-align: top;
  4. margin: 0 -2px 0 -2px;
  5. text-align: center;
Sep 16 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Phil Powell | last post by:
The customer made a wild request: they want on their admin panel a textarea that will display an existing resume. This textarea, however, must have a dynamic width, one that "fills the screen...
4
by: mike eli | last post by:
Hi, I have several absolute positioned elements inside an absolute positioned DIV. I would like one of the nested elements to have a dynamic width. I set it's left and right attributes to 5, so...
3
by: Robert Mark Bram | last post by:
Hi All! Has anyone seen an example of the following javascript powered control: - a dropdown select menu - the width of the control is set. Assume by "control" I mean the visible part of the...
0
by: manssi | last post by:
how to make dynamic editor menu in asp.net i have made application in asp.net but i have no coding for editor menu i want the menu in following order-- forms ..subforms .....subforms
0
by: PandaPanda | last post by:
I created a dynamic hierarchical Organizational Chart using the code at http://thecodeplayer.com/walkthrough/css3-family-tree . The width of the chart will vary depending on the number of positions....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.