We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

How to Center Everything on Custom Page Template (Dawn)

How to Center Everything on Custom Page Template (Dawn)

claribelskincar
Excursionist
15 0 5

Hi there,  I've created a custom page template, but need to know how to center the title and everything else on that custom page please.  Just this template - not any others.  Appreciate your help!

Replies 11 (11)

Moeed
Shopify Partner
7764 2082 2568

Hey @claribelskincar 

 

Can you share that page link with me?

 

Best,

Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


claribelskincar
Excursionist
15 0 5

https://claribelskincare.com/pages/all-natural-eyelash-growth-serum

 

Please ignore the blurbs of text.  I need the title and the text centered, as well as anything else on this particular page.  It is a custom page, so it should not affect any other pages (hopefully). Thank you.

CodingFifty
Shopify Partner
1102 162 191

Go to Online Store, then Theme, and select Edit Code.
Search for base.css/theme.css/style.css/main.css/custom.css file Add the provided code at the end of the file.

.section-template--19196959916269__main-wide-padding {
    text-align: center !important;
}

CodingFifty_0-1750195093378.png

 

Coding Fifty || Shopify Partner
For any custom section queries, please visit: Fiverr Profile
Found my response useful? Like it and mark as Accepted Solution!
For additional discussions, reach out via: Email ID: codingfifty@gmail.com

CodingFifty
Shopify Partner
1102 162 191

Hey @claribelskincar,

Go to Online Store, then Theme, and select Edit Code.
Search for base.css/theme.css/style.css/main.css/custom.css file Add the provided code at the end of the file.

.main-page-title {
    text-align: center !important;
}
Coding Fifty || Shopify Partner
For any custom section queries, please visit: Fiverr Profile
Found my response useful? Like it and mark as Accepted Solution!
For additional discussions, reach out via: Email ID: codingfifty@gmail.com
claribelskincar
Excursionist
15 0 5

I don't have this file.  

claribelskincar
Excursionist
15 0 5

This has to be wrong.  I don't have that file.

bryan76
Navigator
452 9 93

try:

 

{ text-align: center !important; }

 

or

 

* {align-items: center;}

claribelskincar
Excursionist
15 0 5

Am I supposed to add this to my custom page template coding? 

bryan76
Navigator
452 9 93

sorry, add to the Custom CSS of individual sections in the theme editor.  click the section and scroll to the bottom (under padding).  in this section you can edit most anything regarding the visuals like fonts, font size, font color, background color, margins, etc. etc. 

Dan-From-Ryviu
Shopify Partner
12073 2359 2539

You can do that by adding this code to Custom CSS in Sales channels > Online Store > Themes > Customize > Theme settings. 

#shopify-section-template--19196959916269__main-wide * { text-align: center; }

- Helpful? Like & Accept solution!
- 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.

mt686
Shopify Partner
146 12 21

Hey there!

Great question! To center everything on just your custom page template, you'll need to add some CSS that targets only that specific template. Here's how:

Solution: Add template-specific CSS

  1. Go to Shopify Admin → Online Store → Themes → Actions → Edit Code
  2. Find your custom page template file (likely in Templates folder, something like page.custom.liquid)
  3. Add this CSS at the top or bottom of that template file:
<style>
/* Center everything on this custom page only */
.page-width {
  text-align: center;
}

.page-title,
.page__title {
  text-align: center;
}

.rte h1, .rte h2, .rte h3, .rte h4, .rte h5, .rte h6,
.rte p, .rte ul, .rte ol {
  text-align: center;
}

/* Center any images */
.rte img {
  display: block;
  margin: 0 auto;
}

/* Center any buttons */
.btn {
  display: block;
  margin: 0 auto;
  width: fit-content;
}
</style>

Alternative approach - if you want to be more specific, you can target by the page handle:

<style>
/* Replace 'your-page-handle' with your actual page handle */
.template-page .page--your-page-handle {
  text-align: center;
}

.template-page .page--your-page-handle .page-width * {
  text-align: center;
}
</style>

The page handle is the URL-friendly version of your page name (spaces become dashes, etc.).

Quick idea: If you're planning to create more custom layouts or make other design changes, I actually developed Easy Edits that lets you visually center elements, adjust alignments, and customize pages without touching any code. Just click and drag to center everything exactly how you want it!

Try the first code snippet and let me know if everything centers properly for you!