0 votes
1 view
in Web Technology by (20.3k points)

I have a page structure similar to this:


  <div id="parent">

    <div id="childRightCol">



    <div id="childLeftCol">





I would like for the parent div to expand in height when the inner div's height increases.


One problem is that if the width of the child content expands past the width of the browser window, my current CSS puts a horizontal scrollbar on the parent div. I would like the scrollbar to be at the page level. Currently, my parent div is set to overflow: auto;

Can you please help me with the CSS for this?

1 Answer

0 votes
by (40.3k points)

You can try using the code given below for the parent like this:



Or else, you can use this code:


display: table;


display: table-row;

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !