How to center header of featured collections on detskop and mobile? RIDE THEME

Hi, can someone help me to center the headers of these featured collections on the homepage for the detskop and mobile version? Thanks

www.taneau.com

Hello @atm19
Add this CSS code to your css file

.collection__title h2 {
    text-align: center;
}

Let me know if you need any more help.

Hi @atm19 Please add the code in your theme.css/base.css/style.css file which is available in your theme.

.collection__title.title-wrapper.title-wrapper--no-top-margin.page-width.title-wrapper--self-padded-tablet-down {
    text-align: center !important;
}

If you are not sure where is your theme.css/base.css/index.css/style.css file please follow the steps:

  1. Login in shopify admin.
  2. Click on the Online Store.
  3. Then click on the button next to Customize in live Theme.
  4. Click Edit Code.
  5. Search theme.css/base.css/index.css/style.css in the code in left hand side which ever is available in your theme.
  6. You can add the above code at the bottom of the file.

Result:

If you will unable to implement the same then I’m happy to do this for you, let me know. I can implement the code changes so that this will work well for you.

Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as solution!

Best Regards

Sahil

Thanks! but it works only for detskop version i need it also on mobile.

Thank you, but it works only for detskop i need it also on the mobile version.

Try to add important like this

Hi @atm19 Please add !important and it will work well.

Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as solution!

Best Regards

Sahil

  • there is already important and doesnt work:(

on the MOBILE version

@atm19
I can see the text center css but it is applied on hover

Add the CSS directly at the bottom of your base.css file
If you need help do let me know.

Hi @atm19 Try to use this code.

.collection__title.title-wrapper.title-wrapper--no-top-margin.page-width.title-wrapper--self-padded-tablet-down>h2 {
    text-align: center !important;
}

Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as solution!

Best Regards

Sahil

it works thanks. But again not on the mobile version. What should i try other?

Hello @atm19 ,

Please add the below mentioned code at the bottom of the theme.liquid file before tag and save for the desired output in mobile version.

@media screen and (max-width: 720px){ h2.title.inline-richtext.h2.scroll-trigger.animate--slide-in { text-align: center; } }

Output -:

I hope this helps.

Please share if you have any query.

Thank you.

1 Like