Mareka
January 20, 2022, 2:04am
1
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.
Sorry, Your password is not working.
Thank you.
Hi,
Which text you want to be changed ?
Please provide screenshot.
Thank you.
Mareka
January 20, 2022, 5:32am
7
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.
Mareka
January 20, 2022, 5:53am
11
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.
Mareka
January 20, 2022, 6:04am
14
Thanks for that but it is now centre top, I need it just centre please.
Mareka
January 20, 2022, 6:20am
15
@Denishamakwana
the text & button don’t appear to be perfectly centred on the image, can you assist
Hi @Mareka ,
Go to theme editor
Edit Asset/theme.css
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;
}
On my side, it works well
If it works for you, please accept my answer and like it.
Thank you in advance.
Mareka
January 20, 2022, 6:37am
17
@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.
Mareka
January 21, 2022, 12:31am
19
@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.