<br> not working in floxbox

Web site design, graphics, logos, web development,templates design discussions.

Moderators: ushakumarik, DeviSri

Post Reply
Catherine
Posts: 36
Joined: Thu Apr 21, 2022 9:08 am
Contact:

<br> not working in floxbox

Post by Catherine »

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.
User avatar
siteadmin
Site Admin
Posts: 335
Joined: Sun Dec 18, 2005 11:10 am
Contact:

Re: <br> not working in floxbox

Post by siteadmin »

Hi Cathe,

You may try it like this,

.centerEverything {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
Bella
Posts: 35
Joined: Wed Apr 13, 2022 6:27 am
Contact:

Re: <br> not working in floxbox

Post by Bella »

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;
}
Catherine
Posts: 36
Joined: Thu Apr 21, 2022 9:08 am
Contact:

Re: <br> not working in floxbox

Post by Catherine »

Thanks, work great. :D
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests