将两个段落放在不同的标题高度处的相同位置

时间:2019-07-02 16:05:50

标签: html css flexbox

我正在使用CMS,但有很多标题并不总是具有相同的行数。我想将内容对齐到彼此相邻的同一位置。

.row {
  display: flex;
  /* equal height of the children */
}

.col {
  flex: 1;
  /* additionally, equal width */
  padding: 1em;
  border: solid;
}

h1 {
  flex: 1;
  /* additionally, equal width */
  padding: 1em;
  border: solid;
}
<div class="row">
  <div class="col">
    <h1>test</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
  </div>
  <div class="col">
    <h1>test<br>2</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad omnis quae expedita ipsum nobis praesentium velit animi minus amet perspiciatis laboriosam similique debitis iste ratione nemo ea at corporis aliquam.
      <p></p>
  </div>
</div>

0 个答案:

没有答案