# Insert text below username?

**URL:** https://meta.discourse.org/t/insert-text-below-username/308127
**Category:** Development
**Tags:** css
**Created:** [May 15, 2024, 7:23pm UTC](https://meta.discourse.org/t/insert-text-below-username/308127 "2024-05-15T19:23:58Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![DonkeyKongEnjoyer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/donkeykongenjoyer/32/377672_2.png) [@DonkeyKongEnjoyer](https://meta.discourse.org/u/DonkeyKongEnjoyer)
#### Post date: [May 15, 2024, 7:23pm UTC](https://meta.discourse.org/t/insert-text-below-username/308127/1 "2024-05-15T19:23:58Z")

</div>

Is there any way to insert a line of text below usernames? Ideally, I’d like this to appear under everyone’s username.

 ![usernamebelow](https://global.discourse-cdn.com/meta/original/4X/f/6/0/f6056129af8a373e61eee166b8e622811a94436b.png)

The CSS I used to achieve this is:

```plaintext
.username::after {
    content: 'website.com';
    font-size: 14px;
} 

```

But obviously I’d like for it to appear below. Thanks!

---

<div class="post-metadata">

### Author: ![Alteras](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alteras/32/179824_2.png) [@Alteras](https://meta.discourse.org/u/Alteras)
#### Post date: [May 15, 2024, 10:34pm UTC](https://meta.discourse.org/t/insert-text-below-username/308127/2 "2024-05-15T22:34:58Z")

</div>

Would this work for you?

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/1/4/714af844bb5c1a7eb5e621317ca3c6b9524f198f.png)

```css
.topic-meta-data .names {
  flex-wrap: wrap;
}

.names::after {
  display: block;
  content: "hello world";
  font-size: 14px;
  width: 100%;
  flex: 1 0 100%;
  order: 4;
}

```

edit: added `order` property for mobile

---

<div class="post-metadata">

### Author: ![DonkeyKongEnjoyer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/donkeykongenjoyer/32/377672_2.png) [@DonkeyKongEnjoyer](https://meta.discourse.org/u/DonkeyKongEnjoyer)
#### Post date: [May 15, 2024, 11:25pm UTC](https://meta.discourse.org/t/insert-text-below-username/308127/3 "2024-05-15T23:25:13Z")

</div>

> [@Alteras](#):
>
> Would this work for you?

Thank you! It works perfectly on Desktop, but for whatever reason it shows above the username on mobile.

---

<div class="post-metadata">

### Author: ![Alteras](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alteras/32/179824_2.png) [@Alteras](https://meta.discourse.org/u/Alteras)
#### Post date: [May 15, 2024, 11:35pm UTC](https://meta.discourse.org/t/insert-text-below-username/308127/4 "2024-05-15T23:35:28Z")

</div>

Oh. Interesting. they have an additional `order` property on mobile.

You can add `order: 4` to the after pseudo element and it should fix it.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [May 15, 2024, 11:36pm UTC](https://meta.discourse.org/t/insert-text-below-username/308127/5 "2024-05-15T23:36:32Z")

</div>

You could achieve this with Group Default Titles.

Groups can have Default titles which appear by the username.

That way you can have a different one for each Group.

You could style those with CSS to appear underneath if you so chose.

---

<div class="post-metadata">

### Author: ![DonkeyKongEnjoyer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/donkeykongenjoyer/32/377672_2.png) [@DonkeyKongEnjoyer](https://meta.discourse.org/u/DonkeyKongEnjoyer)
#### Post date: [May 15, 2024, 11:46pm UTC](https://meta.discourse.org/t/insert-text-below-username/308127/6 "2024-05-15T23:46:01Z")

</div>

> [@Alteras](#):
>
> You can add `order: 4` to the after pseudo element and it should fix it.

Works perfectly, thank you!

---

<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: [May 16, 2024, 12:37am UTC](https://meta.discourse.org/t/insert-text-below-username/308127/7 "2024-05-16T00:37:29Z")

</div>

You could also use the API if you need to adjust the content programmatically (to check the user, the post, etc.).

For example:

```js
api.decorateWidget("poster-name:after", (dec) => {
    // "dec.attrs" to access the attributes of the post
    return dec.h("div", "meta.discourse.org");
  });

```

```css
.topic-meta-data .trigger-user-card {
    flex-direction: column;
    align-items: flex-start;
}

```

![image](https://global.discourse-cdn.com/meta/original/4X/d/1/2/d125409fdbe384397e6cd49cc9e16ec8bf9490c0.png)

---

<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: [June 15, 2024, 12:37am UTC](https://meta.discourse.org/t/insert-text-below-username/308127/8 "2024-06-15T00:37:45Z")

</div>

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