如何水平和垂直对齐 "block" 中 div 的元素?

How do I align elements of a div in a "block" horizontally and vertically?

我在 div 中有 3 个元素,我希望它们在一个块中(垂直)并水平和垂直对齐。这是现在的样子:

这是我的代码:

<div className="parent">
        <p className="heading">TITLE</p>
        <p className="description"><strong>DISCLAIMER</strong>: The site contains offensive, vulgar langauge which may not be<br/>suitable for many, so enter with caution and do not reveal any personal details</p>
        <Link to="/school"><button className="enterButton">enter the website</button></Link>
    </div>

----------------------
stylesheet.css
----------------------
.parent {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .heading {
    font-size: 76px;
    text-align: center;
  }

  .description {
    font-size: 18px;
    opacity: .7;
    text-align: center;
    line-height: 26px;
  }

  .enterButton {
      width: 360px;
      height: 100px;
      background-color: #E1E8ED;
      color: #15202B;
      font-size: 32px;
      font-weight: bolder;
      text-align: center;
      border: none
  }

我希望它们对齐并彼此下方,例如:

TITLE
Disclaimer
Enter the website

Flex-direction 列用于设置元素在 flex 父元素中的对齐方式。您已经将两个轴与 align-items: centerjustify-content: center.

中心对齐
.parent {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

会成功的...