# Como centralizar o texto na prévia do tópico?

**URL:** https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401
**Category:** Support
**Created:** [1 Março , 2019 00:01 UTC](https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401 "2019-03-01T00:01:01Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![nexo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nexo/32/106384_2.png) [@nexo](https://meta.discourse.org/u/nexo)
#### Post date: [1 Março , 2019 00:01 UTC](https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401/1 "2019-03-01T00:01:02Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/4/f/4f0311a4a5de15edba942b74ba2ababd8936fd8a.png)  
Hi, how can I vertically center (bring down) the **title, category, and tag** on the topic preview next to the image? Thanks.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [1 Março , 2019 00:22 UTC](https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401/2 "2019-03-01T00:22:30Z")

</div>

What about simply:

```CSS
.main-link {
    display: flex;
    align-items: center;
}

```

It should be okay in your case.

---

<div class="post-metadata">

### Author: ![nexo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nexo/32/106384_2.png) [@nexo](https://meta.discourse.org/u/nexo)
#### Post date: [1 Março , 2019 00:55 UTC](https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401/3 "2019-03-01T00:55:20Z")

</div>

Thank you so much 🙂

---

<div class="post-metadata">

### Author: ![nexo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nexo/32/106384_2.png) [@nexo](https://meta.discourse.org/u/nexo)
#### Post date: [1 Março , 2019 08:48 UTC](https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401/4 "2019-03-01T08:48:32Z")

</div>

I’ve noticed that while that works on Desktop, on mobile it remains the uncentered on mobile. (I’ve tried pasting the css into the mobile stylesheet)

 ![Screenshot_20190301-004347_Chrome](https://global.discourse-cdn.com/meta/original/3X/3/0/3022f2ea727b58cf250793b3e8c4d3a5a1ec1f0f.jpeg)

---

<div class="post-metadata">

### Author: ![nexo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nexo/32/106384_2.png) [@nexo](https://meta.discourse.org/u/nexo)
#### Post date: [1 Março , 2019 19:52 UTC](https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401/5 "2019-03-01T19:52:54Z")

</div>

Any discovery to this? I’ve been playing around with the code, but no luck

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [2 Março , 2019 13:34 UTC](https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401/6 "2019-03-02T13:34:03Z")

</div>

It’s a little more tricky.

I don’t know if it will work in all situations, but you can try and adjust the following:

For mobile only:

```CSS
.topic-list-item {
    td {
        display: flex;
        align-items: center;
        max-width: 100%;
        position: relative;
    }
    
    .topic-details {
        flex: 2;
        
        display: flex;
        flex-direction: column;
        min-height: initial !important;
        position: initial !important;
        overflow: visible;
        
        .pull-right {
            position: absolute;
            right: 0;
            top: 0.5em;
            bottom: 0;
        }
        
        .num.activity {
            bottom: 0.5em;
        }
    }
    
    .topic-actions {
        flex: 0 0 100%;
    }
}

```

 ![image](https://global.discourse-cdn.com/meta/original/3X/0/6/06f8f98433c8b3ee47d4bfa6a8a83e9037a8a6ff.png)

---

<div class="post-metadata">

### Author: ![nexo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nexo/32/106384_2.png) [@nexo](https://meta.discourse.org/u/nexo)
#### Post date: [3 Março , 2019 01:15 UTC](https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401/7 "2019-03-03T01:15:49Z")

</div>

What a wonder! Thank you mate!

---

<div class="post-metadata">

### Author: ![nexo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nexo/32/106384_2.png) [@nexo](https://meta.discourse.org/u/nexo)
#### Post date: [3 Março , 2019 06:41 UTC](https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401/8 "2019-03-03T06:41:01Z")

</div>

Another problem arises. The suggested topics table gets completely scattered/broken. Now what can be done 😕 I’ve played around with as much CSS as I know. `vertical-align` doesn’t work..

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [3 Março , 2019 12:31 UTC](https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401/9 "2019-03-03T12:31:30Z")

</div>

Can you show me a screenshot of what you mean?

---

<div class="post-metadata">

### Author: ![nexo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nexo/32/106384_2.png) [@nexo](https://meta.discourse.org/u/nexo)
#### Post date: [3 Março , 2019 17:19 UTC](https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401/10 "2019-03-03T17:19:57Z")

</div>

![Screenshot_20190302-205545_Chrome](https://global.discourse-cdn.com/meta/original/3X/e/6/e6ada413ea247045b21a12c07bea9a1d77012a18.jpeg)

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [3 Março , 2019 17:37 UTC](https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401/11 "2019-03-03T17:37:21Z")

</div>

Then, you should try to target only the main topics list.

What about replacing the selector by: `.contents .topic-list-item {` ? (note the `.contents`)

---

<div class="post-metadata">

### Author: ![nexo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nexo/32/106384_2.png) [@nexo](https://meta.discourse.org/u/nexo)
#### Post date: [3 Março , 2019 19:54 UTC](https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401/12 "2019-03-03T19:54:04Z")

</div>

It works a lot better, I noticed that the post count and username of the latest poster gets overlapped when the **topic title is 2 lines or longer**.

 ![Screenshot_20190303-120327_Chrome](https://global.discourse-cdn.com/meta/original/3X/9/5/9535a6794346472eaca3e9720ac61765b9fff000.jpeg)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2 Abril , 2019 19:54 UTC](https://meta.discourse.org/t/how-to-center-text-on-topic-preview/110401/13 "2019-04-02T19:54:05Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
