How to align to center the collection title on the main page, craft theme

Hello

I want to align the title under a collection card in the centre, currently it is aligned left. how can i do that?

thank you

1 Like

Hi @schmidt0812 ,
Just copy paste the below code at the bottom of the base.css file in the shopify theme code editor.

/** CSS TO ALLIGN COLLECtION TITLE IN CENTER **/
h1.collection-hero__title {
    text-align: center;
}

After you have added the code then your collection title would be displayed as shown in the image below:

Thanks

Hello @schmidt0812 ,

I would like to give you some recommendations to support.

Please go to Online Store > Themes > click 3 dots button > Edit code > Base.css add code at the end of the file Base.css.

.collection-hero h1.collection-hero__title {
text-align: center !important;
}

I hope you find the answer helpful.

Kind & Best regards,
GemPages

3 Likes

thank you it worked !

1 Like

Hi @schmidt0812 ,

I am so glad that solution can help.

Kind & Best regards,
GemPages

1 Like

Thank you also - this worked for me. However how do I get the Collection description to centre underneath? It’s odd that you can’t actually centre the text on the page - all it does is justify it.

https://6n0v3g9rc92wkm6k-26310766.shopifypreview.com

If you navigate to ‘Wear’ > Baby 0-2yrs > Shop All - you’ll see what I mean.

I need to figure this out, too, BabyEden.

Did you figure this out, by chance?

It hasnt worked for me. Please help

did you ever fix this?

@GemPages

How to do it for the specific page that we have created ? For example, “Mens Shirts” Page or “About us” page.