Vertically align login page and horizontally align text

Topic summary

A user sought help vertically centering their Shopify login page content and horizontally aligning the “forgot password” link.

Solutions Provided:

  • Multiple users suggested adding custom CSS code to the theme.liquid file (above the </body> tag)
  • One alternative approach recommended using the Theme settings > Custom CSS section with flexbox properties

Resolution:

  • The user confirmed that Dan-From-Ryviu’s solution successfully resolved the issue
  • The working code centered both the login form vertically and the text elements horizontally
  • Screenshots were shared showing the before/after results

Status: Resolved. The user received multiple working solutions and implemented one successfully.

Summarized with AI on November 2. AI used: claude-sonnet-4-5-20250929.

Hi there,

I need to know that how can I vertically middle align my login page content and also horizontally center align the forgot password link in the login page.

Thank You

website : https://www.corenhance.store/account/login

password : [email removed]

1 Like

Hey @corenhance

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code in the bottom of the file above tag


RESULT:

If I managed to help you then, don’t forget to Like it and Mark it as Solution!

Best Regards,
Moeed

1 Like

Hi @corenhance

Please add this code to theme.liquid file in Online Store > Themes > Edit code


1 Like

Hi @Moeed , Thanks but it didn’t made the text to the center.

Hi @Dan-From-Ryviu ,

Thank You so much. It really worked.

1 Like

Hi @corenhance , thanks for reaching out.

To address the issue, please help me go to your Theme => Online store => Customize => Theme settings => Custom CSS and insert the following custom code:

form#customer_login {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

You can take a look at the expected result here:

I hope my solution is helpful to you, and please feel free to feedback.

Esther

1 Like

You are very welcome!

Hi @EstherBui , Thank You for your help. But I’ve already got the solution.