I am trying to put text that is centered horizontally and vertically in an item on the template. The issue is if I use |linebreaks, it appears there is a line break at the end of the text so the text does not center vertically. If I leave out the |linebreaks, text centers properly but line breaks between text is ignored. I tried removing the last line break and whitespace with .rstrip but that did not help.
The actual HTML rendered is:
<p>Tets<br>Test</p>
The relevant code is:
css
.Objective {
width: 8vw;
height: 8vh;
margin: auto;
align-content: center;
background-color: white;
color: black;
border: 5px solid black;
vertical-align: middle;
text-align: center;
font-size: 2vh;
font-weight: bold;
border-radius: 10px;
justify-content: center;
}
Fixed it. The issue was the paragraph tag:
<p>
needed formatting to remove default margins and properly center text. Adding this fixed issue:
.Objective p {
margin: 0; /* Remove default paragraph margins to center text properly */
}
Left post in case someone else has same issue