How do I create a line break here to separate two lines?

Code: https://jsfiddle.net/tnLv7dcs/1/

#holder {
  width: 400px;
  height: 400px;
  background: #000000;
  position: relative;
}

.hvcentered {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 272px;
  height: 272px;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
  background: white;
}

.text1 {
  font-family: Georgia;
  font-size: 35px;
  font-weight: 900;
  text-align: center;
  color: #38761d;
  
}

.text2 {
  font-family: Georgia;
  font-size: 35px;
  font-weight: 900;
  text-align: center;
  color: #38761d;
}
<div id="holder">
  <div class="hvcentered">
  
  <p class="text1">One set of text</p>
  
 <p class="text2">One set of text</p>
  </div>
</div>

In your current code you would add flex-direction:column to .hvcentred and then remove the default margins from the p element if you want them close together.

e.g.

.hvcentered {
flex-direction:column;
}
p{margin:0;}

Of course you don’t actually need a holder element just for that black border and the absolute positioning seems redundant in that example…

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.