0

Paragraph element is not going on the next line of the other paragraph element.

body {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: #000;
}

p {
  position: relative;
  font-family: sans-serif;
  text-transform: uppercase;
  font-size: 2em;
  letter-spacing: 4px;
  overflow: hidden;
  background: linear-gradient(90deg, #000, #000fe6, #000);
  background-repeat: no-repeat;
  background-size: 80%;
  animation: animate 3.75s linear infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: rgba(45, 45, 45, .05);
}

@keyframes animate {
  0% {
    background-position: -500%;
  }
  100% {
    background-position: 500%;
  }
}
<body>
  <p>Title</p>
  <p>Tag Line</p>
</body>

Here, Tag Line should go below the Title, but it's beside it.

Paragraph element is not going on the next line of the other paragraph element.

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
Pal
  • 85
  • 5

1 Answers1

1

You can add flex-direction:column; to body.

divulliame
  • 11
  • 1
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/22592386) – Reza Mousavi Mar 28 '19 at 09:32
  • @RezaMousavi This *is* an answer, and it's even a correct answer - try editing `flex-direction:column;` into the snippet in the question, and it'll work. – CertainPerformance Mar 28 '19 at 09:38