-2

How could i make sure my <p class="title"></p> and <p class="subtitle"></p> are displayed underneath of eachother because right now they are being displayed next to eachother

Noah Bergh
  • 493
  • 4
  • 14
  • Do you already have some CSS? Could you please share it here? If you write two `p` tags the second already goes in new line. – Balastrong Sep 16 '21 at 18:13

1 Answers1

0

You can make use of flexbox, it'll definitely solve your problem.

Example

If you want to arrange two items underlying with each other:

.container {
    display: flex;
    flex-direction: column;
}
<div class="container">
<p class="title">Hello</p>
<p class="subtitle">World</p>
</div>

If you want to arrange two items next to each other.

.container {
    display: flex; /*by default it will align items in one row*/
}
   <div class="container">
    <p class="title">Hello</p>
    <p class="subtitle">World</p>
    </div>
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Uttam
  • 718
  • 6
  • 19