Make center text center aligned

Hello,

I believe this code is making my text column-wise and I am unable to make it center aligned
<div class=“grid__col grid__col–1of2”>.

Can someone help with what code I should use the make the text center aligned?

PS. I have limited coding skills :slightly_smiling_face:

Hi @NisantaSahoo,

if you want to center the text in the column. You can:

  1. add inline-styling

like this

<div class="grid__col grid__col--1of2" style="text-align:center">

to it. It will work, but I don’t recommend inline-styling

  1. create a simple CSS class

like this

module/template(or where ever this div is)

<div class="grid__col grid__col--1of2 text-centered">

Your main CSS file:

.text-centered{
text-align:center;
}

This will give you more control over media queries(responsiveness).

best,

Anton

Moderator note: While this solution may not address the original poster’s specific situation, it could be helpful for other community members facing similar challenges.

Hi Anton,

Thanks a lot for the response, but I do not want the text to be centered inside the column. That’s not my purpose, I want it to be center aligned on the page. Please take a look at the design layout

Hi @NisantaSahoo,

could you please post a preview link to the page (not template)?

Thank you

Anton

I didn’t get you, the page is not published yet

There are horizontal spacer modules you can put to the left and right to reduce the width and center your content. Or you can use css and give it a maximum width and center it with auto margin, but sounds like you want to avoid code.