# Text not aligning right

**URL:** <https://forum.freecodecamp.org/t/text-not-aligning-right/160337>\
**Category:** General\
**Created:** [November 22, 2017, 8:38am UTC](https://forum.freecodecamp.org/t/text-not-aligning-right/160337 "2017-11-22T08:38:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JB-Walker](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jb-walker/32/71410_2.png) [@JB-Walker](https://forum.freecodecamp.org/u/JB-Walker)\
**Post date:** [November 22, 2017, 8:38am UTC](https://forum.freecodecamp.org/t/text-not-aligning-right/160337/1 "2017-11-22T08:38:09Z")

</div>

This code displays 100 rotating images, which are not accessible by codepen. Ignore the jumpiness. The only part that is not working is the center-left text block:

The mission of World Childhood  
rights of children and to promote  
vulnerable and exploited children  
By investing in children at an early  
marginalization,

This text should be aligning right, but is not doing so. Any ideas? Thanks

> **[Tribute](https://codepen.io/J_a_m_e_s/pen/XzEQjq)**
>
> ...

---

<div class="post-metadata">

**Author:** ![kevcomedia](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/kevcomedia/32/125737_2.png) [@kevcomedia](https://forum.freecodecamp.org/u/kevcomedia)\
**Post date:** [November 22, 2017, 8:48am UTC](https://forum.freecodecamp.org/t/text-not-aligning-right/160337/2 "2017-11-22T08:48:29Z")

</div>

I have no idea why, but it seems to be caused by the `display: none` property.

EDIT. `text-align` only works on block elements, which is changed by `display: none`

---

<div class="post-metadata">

**Author:** ![JB-Walker](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jb-walker/32/71410_2.png) [@JB-Walker](https://forum.freecodecamp.org/u/JB-Walker)\
**Post date:** [November 22, 2017, 10:09pm UTC](https://forum.freecodecamp.org/t/text-not-aligning-right/160337/3 "2017-11-22T22:09:42Z")

</div>

@kevcomedia Bingo!

The **display:none** property hides the text behind an image until a timer expires, at which point I was changing the display property to **initial** , which displayed the text, but prevented it from being aligned. Changing **initial** to **block** solved the problem.

Thanks!

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:34pm UTC](https://forum.freecodecamp.org/t/text-not-aligning-right/160337/4 "2021-01-17T20:34:02Z")

</div>

Closed on January 17, 2021, 8:34pm UTC


