JSFiddle - React, Tailwind, and code Playground

by Front Dev

HTML

<div id="container2">
    <div class="container--inner">
        
      <div id="rightCol2">How to adjust the divs automatically to the height of the other.</div>
        
        <div class="col2"><div id="leftCol2">
            <p>In this example this div is heigher.</p>
            <p>In this example this div is heigher.</p>
            <p>In this example this div is heigher.</p>
            <p>In this example this div is heigher.</p>
            <p>In this example this div is heigher.</p>
            <p>In this example this div is heigher.</p>
            <p>In this example this div is heigher.</p>
            <p>In this example this div is heigher.</p>
            <p>In this example this div is heigher.</p>
            <p>In this example this div is heigher.</p>
            <p>In this example this div is heigher.</p>
            <p>In this example this div is heigher.</p>
            <p>In this example this div is heigher.</p>
            <p>In this example this div is heigher.</p>
            </div></div>
    </div>
</div>

CSS

body, html {
    height:100%;
}
#container2 {
    margin: 10px auto;
    width: 927px;   
}
.container--inner{
    display:table;
}
.col2{
    display:table-cell; 
}
p{
    margin:0;
    padding:10px 0;
}
#leftCol2 {
    width: 195px;
    background: #FCF;
    z-index:-1;
    padding:0;
    margin:0;
}
#rightCol2 {
    width:732px;
    background: #CFF;
    z-index:1;
    padding:0;
    margin:0;
    display:table-cell; 
}