How can I adjust text position on a hero banner in debut theme?

Hello,

Depending on the image I use for my hero banner in debut theme, I need to be able to move the text position. For example, the image I used over the Christmas period, the text was positioned top centre of the image. I now want to move the text to the centre of my new image. I have tried to changing the previous coding I was given, but nothing changes. Can somebody please assist. My store is currently paused. www.treasureknot.com

2 Likes

Hello There,

Please share your store password.
So that I will check and let you know the exact solution here.

Millie030913

Sorry, Your password is not working.

Thank you.

Sorry, try Millie0309

Hi,

Which text you want to be changed ?

Please provide screenshot.

Thank you.

The text & button on the hero banner please. I would like to be able to move this text easily for different images.

@Mareka

Please share your store password.
So that I will check and let you know the exact solution here.

Thanks!

Hi,

There is no text and button found on hero banner.

Thank you.

Millie0309

Sorry, please see this preview https://2s9lzatlf2ddx0gp-34503295108.shopifypreview.com

1 Like

@Mareka

Please add the following CSS code to your assets/theme.scss.liquid bottom of the file.

#shopify-section-1629938477f33176ac .hero__inner .text-center {
    text-align: center !important;
}

Thanks!

Please add this below code in bottom of assets/theme.scss.css file

.hero__inner .page-width.text-center {

display: flex;

justify-content: center;

align-items: center;

flex-wrap: wrap;

width: 100%;

}
.text-center .mega-subtitle {
width: 100%;
}

.hero__inner .text-center {
text-align: center !important;

}
Thank you.

Thanks for that but it is now centre top, I need it just centre please.

@Denishamakwana

the text & button don’t appear to be perfectly centred on the image, can you assist

Hi @Mareka ,

  1. Go to theme editor

  2. Edit Asset/theme.css

  3. Add the following CSS to the bottom of theme.css

.hero__inner .page-width.text-center {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -150px;
    margin-left: -230px;
    width: 460px !important;
    height: 300px;
}
  1. On my side, it works well

If it works for you, please accept my answer and like it.

Thank you in advance.

@GavinChan

Thanks so much, it works. So if I change image & want to move the text to the right top of the image, I just need to adjust the percentage & pixel margins within that coding ?

you can try this one.

.hero__inner .page-width.text-center {

height:100%;

}

Thank you.

@GavinChan

Worked great for desktop but not so much for mobile. The ends of the text get chopped off.

Also, can I make the text font only larger on desktop only ?

Hi,

Please try this below code again it’s really helpful for you.

.hero__inner .page-width.text-center .hero__btn {
margin-top: 0!important;

}

.hero__inner .text-center {
text-align: center!important;
display: flex;
flex-wrap: wrap;
width: 100%;
height: 100%;
align-items: center;
justify-content: center;

}

.text-center .mega-subtitle {
width: 100%;

}
Thank you.