<!DOCTYPE html>
<style>
  .container {
    border: 2px solid blue;
  }

  .item {
    border: 2px solid red;
  }
</style>

<div class="container">
  <div class="item">
    Line 1<br>
    Line 2
  </div>
</div>

<div class="container">
  <div class="item">
    Line 1
  </div>
  <div class="item">
    Line 1<br>
    Line 2
  </div>
</div>
