CMS Development

tam1445
Participant

Align text for-mobile devices

SOLVE

Is there a way to adjust mobile styles so that specific text is left-justified on desktop but centered on mobile devices?

 

I'm trying to do this for the blue copy in this email:

http://info.6monthsmiles.com/-temporary-slug-27a3d667-167c-49a9-a0fe-9810d15a1a88?hs_preview=OEDMDNw...

 

thanks!

0 Upvotes
1 Accepted solution
Reg
Solution
Contributor | Elite Partner
Contributor | Elite Partner

Align text for-mobile devices

SOLVE

You would need to add a media query and a class to the text you want centered. You can add the class by clicking the cog to edit css declarations and add it to the custom css class box.

 

centered-text-class.png

 

For example the media query would look like this:

 

<style>

@media screen and (max-width:479px) {

 

.centered-mobile p{

text-align:center;

}

}

</style>

 

In this example any paragraph tags within the class .centered-mobile will be center aligned on devices smaller than 479px.

 

Cheers,

Reg

Reg Desgroseilliers
www.rdcoding.com

View solution in original post

3 Replies 3
WSpecs
Member

Align text for-mobile devices

SOLVE

No, there isn't.

0 Upvotes
Reg
Solution
Contributor | Elite Partner
Contributor | Elite Partner

Align text for-mobile devices

SOLVE

You would need to add a media query and a class to the text you want centered. You can add the class by clicking the cog to edit css declarations and add it to the custom css class box.

 

centered-text-class.png

 

For example the media query would look like this:

 

<style>

@media screen and (max-width:479px) {

 

.centered-mobile p{

text-align:center;

}

}

</style>

 

In this example any paragraph tags within the class .centered-mobile will be center aligned on devices smaller than 479px.

 

Cheers,

Reg

Reg Desgroseilliers
www.rdcoding.com
WSpecs
Member

Align text for-mobile devices

SOLVE

No. This won't work.

0 Upvotes