# Align text for-mobile devices

**URL:** <https://community.hubspot.com/t/align-text-for-mobile-devices/3513>\
**Category:** CMS Development\
**Created:** [October 5, 2017, 3:57pm UTC](https://community.hubspot.com/t/align-text-for-mobile-devices/3513 "2017-10-05T15:57:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tam1445](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tam1445/32/57010_2.png) [@tam1445](https://community.hubspot.com/u/tam1445)\
**Post date:** [October 5, 2017, 3:57pm UTC](https://community.hubspot.com/t/align-text-for-mobile-devices/3513/1 "2017-10-05T15:57:45Z")

</div>

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=OEDMDNwa-5367842957](http://info.6monthsmiles.com/-temporary-slug-27a3d667-167c-49a9-a0fe-9810d15a1a88?hs_preview=OEDMDNwa-5367842957)

thanks!

---

<div class="post-metadata">

**Author:** ![Reg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/reg/32/42561_2.png) [@Reg](https://community.hubspot.com/u/Reg)\
**Post date:** [October 6, 2017, 6:35pm UTC](https://community.hubspot.com/t/align-text-for-mobile-devices/3513/2 "2017-10-06T18:35:09Z")

</div>

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](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/7f7a84ac519e80932d168439dfcfe9b2ef8855ac.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

---

<div class="post-metadata">

**Author:** ![WSpecs](https://avatars.discourse-cdn.com/v4/letter/w/dfb087/32.png) [@WSpecs](https://community.hubspot.com/u/WSpecs)\
**Post date:** [March 22, 2022, 6:20pm UTC](https://community.hubspot.com/t/align-text-for-mobile-devices/3513/3 "2022-03-22T18:20:20Z")

</div>

**No**. This won’t work.

---

<div class="post-metadata">

**Author:** ![WSpecs](https://avatars.discourse-cdn.com/v4/letter/w/dfb087/32.png) [@WSpecs](https://community.hubspot.com/u/WSpecs)\
**Post date:** [March 22, 2022, 6:20pm UTC](https://community.hubspot.com/t/align-text-for-mobile-devices/3513/4 "2022-03-22T18:20:40Z")

</div>

**No** , there isn’t.
