Vertically align login page and horizontally align text

Solved

Vertically align login page and horizontally align text

corenhance
Excursionist
21 0 3

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.

Screenshot 2025-01-15 121826.png

Thank You

 

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

password : cn@2025 

Accepted Solution (1)

Dan-From-Ryviu
Shopify Partner
11931 2340 2515

This is an accepted solution.

Hi @corenhance 

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

<style>
#MainContent:has(.login) {
    display: flex;
    align-items: center;
    justify-content: center;
}
#MainContent:has(.login) .login a {
    width: auto;
}
</style>

Screenshot 2025-01-15 at 14.01.03.png

- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

View solution in original post

Replies 7 (7)

Moeed
Shopify Partner
7688 2067 2548

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 </body> tag

<style>
main#MainContent {
    align-content: center !important;
}
form#customer_login {
    place-items: center !important;
}
</style>

RESULT:

Moeed_0-1736924420680.png

 

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

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


corenhance
Excursionist
21 0 3

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

Dan-From-Ryviu
Shopify Partner
11931 2340 2515

This is an accepted solution.

Hi @corenhance 

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

<style>
#MainContent:has(.login) {
    display: flex;
    align-items: center;
    justify-content: center;
}
#MainContent:has(.login) .login a {
    width: auto;
}
</style>

Screenshot 2025-01-15 at 14.01.03.png

- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

corenhance
Excursionist
21 0 3

Hi @Dan-From-Ryviu,

Thank You so much. It really worked.

Dan-From-Ryviu
Shopify Partner
11931 2340 2515

You are very welcome! 

- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

EstherBui
Trailblazer
276 39 44

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: 

 

image (5).png

 

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

 

Esther 

Please let us know if our reply is helpful by giving it a Like or marking it as a Solution!

corenhance
Excursionist
21 0 3

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