I have this very straightforward jumbotron class :
HTML
<div class="jumbotron">Welcome to my fake shop</div>
CSS
body, html {
margin:0;
padding:0;
height:100%
}
.jumbotron {
background: blue;
height:100%;
display:flex;
justify-content: center;
align-items: center;
font-size: 10vw;
text-align:center;
}
It works perfectly fine and as expected in CodePen:
https://codepen.io/laudem/pen/ZExYvMZ
- Div is taking all the place
- Text is centered both vertically and horizontally
- If the
font-sizeget larger, the phrase wraps onto the next line
However, this exact same code produces a different result in my code (angular)

- Div is taking all the place – Good
- Text is centered, both vertically and horizontally – Good
- But if the
font-sizegets larger, instead of the phrase wrapping onto the new line, it overlaps the first one.
Any idea why?
>Solution :
**Set line height **
.jumbotron {line-height:1.5;}
