Hello, anyone can pls help me with a css issue, where I want to make the height of a div flexible based on the content?
I have 2 divs, the first one being a large div which contains menus, and the second div for text content. The first div is used to display menus items, and can contain up to 3 lines of items, with a width of 750px. However it can also at times contain either 2 or a single line of menus, depending on my menu structure.
I would like, in such cases, to make the 2nd div, with the content, then move up to leave something around 15to 20 px of spacing between the two divs.
How can I proceed? The first div has a height css to it, which in my case is 125px (which is the height when displaying the 3 menu levels)
Jump to Post
Do your divs look something like this?
<div id="container"> <div id="menu">First</div> <div id="content">Second</div> </div>
All 5 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.