CMS Development

NisantaSahoo
Colaborador(a)

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 🙂

0 Avaliação positiva
5 Respostas 5
JanetArmstrong
Top colaborador(a) | Parceiro
Top colaborador(a) | Parceiro

Make center text center aligned

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.

 

Anton
Especialista reconhecido(a) | Parceiro Diamante
Especialista reconhecido(a) | Parceiro Diamante

Make center text center aligned

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

Anton Bujanowski Signature
NisantaSahoo
Colaborador(a)

Make center text center aligned

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 scrnli_9_8_2022_11-31-10 AM.png

 

0 Avaliação positiva
Anton
Especialista reconhecido(a) | Parceiro Diamante
Especialista reconhecido(a) | Parceiro Diamante

Make center text center aligned

Hi @NisantaSahoo

 

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

 

Thank you

 

Anton

Anton Bujanowski Signature
0 Avaliação positiva
NisantaSahoo
Colaborador(a)

Make center text center aligned

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

0 Avaliação positiva