Hi Guys,
I've created a simple login page and I want everything appears in the center vertically and horizontally. This would use mostly on a mobile phone. So I use flexbox as a solution.
The problem: the <br> tag doesn't seem to work in flexbox.
CSS
.centerEverything {
display: flex;
justify-content: center;
align-items: center;
}
How do I fix this and thanks in advance.
<br> not working in floxbox
Moderators: ushakumarik, DeviSri
Re: <br> not working in floxbox
Hi Cathe,
You may try it like this,
.centerEverything {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
You may try it like this,
.centerEverything {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
Re: <br> not working in floxbox
hi,
Also if you want to add spaces between the fields and the button you can add a line-height:
.centerEverything {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
line-height: 2em;
}
Also if you want to add spaces between the fields and the button you can add a line-height:
.centerEverything {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
line-height: 2em;
}
Re: <br> not working in floxbox
Thanks, work great.
Who is online
Users browsing this forum: No registered users and 3 guests