CSS Layout How to - Make Two Floated CSS Elements the Same Height








Question

We would like to know how to make Two Floated CSS Elements the Same Height.

Answer


<!--from  w ww  .j  a  va 2  s. c o  m-->
<!DOCTYPE html>
<html>
<head>
</head>
<body>
  <div style="display: table;">
    <div style="display: table-cell; border: 1px solid #CCC;">
      some text <br> another line <br> another line <br>
      another line
    </div>
    <div style="display: table-cell; border: 1px solid #CCC;">some
      other text</div>
  </div>
</body>
</html>

The code above is rendered as follows: