so i'm having this problem where i can't seem to figure out how i should make lis height equal to the highest one ONLY in that row. I got it to work, however it makes ALL lis height the same as the highest one. Here's the code i have so far: https://codepen.io/benasl/pen/ooLrON?editors=1010
var max = -1;
var list = document.getElementsByTagName('li');
Array.prototype.forEach.call(list, function(child) {
max = max > child.style.height ? max : child.offsetHeight;
console.log(child.offsetHeight);
});
Array.prototype.forEach.call(list, function(child) {
child.style.height = max + 'px';
});
ul {
list-style: none;
padding: 0;
width: 100%;
}
li {
padding: 5px 10px;
display:block;
position:relative;
height: 100%;
}
p {
width: 100%;
}
<div class="row">
<div class="col-sm-4">
<ul>
<li><p>testt tte sttest testtesttesttes ttesttes ttesttesttest</p></li>
<li><p>test</p></li>
<li><p>test aaaaaaaa aaaaaaaaa a aaaa aaaaaaaa</p></li>
<li><p>test</p></li>
</ul>
</div>
<div class="col-sm-4">
<ul>
<li><p>testtesttestt esttesttesttes ttesttesttestte sttesttest</p></li>
<li><p>test</p></li>
<li><p>test aaaaaaaa aaaaaaaaa a aaaa aaaaaaaa</p></li>
<li><p>test</p></li>
</ul>
</div>
<div class="col-sm-4">
<ul>
<li><p>testtest testtes ttesttes ttesttesttestt esttestte assaas sasaas saassa sasasasaassa sttest</p></li>
<li><p>test</p></li>
<li><p>test aaaaaaaa aaaaaaaaa a aaaa aaaaaaaa</p></li>
<li><p>test</p></li>
</ul>
</div>
</div>
liby row. You have one big bucket that all thelibelow to so it's going to find the tallest one and make them all that size.