I have this very straightforward jumbotron class :
HTML
<div >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:
- Div is taking all the place
- Text is centered both vertically and horizontally
- If the
font-size
get 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-size
gets larger, instead of the phrase wrapping onto the new line, it overlaps the first one.
Any idea why?
CodePudding user response:
**Set line height **
.jumbotron {line-height:1.5;}