# Meta Post - Common CSS Hacks

**URL:** <https://forum.obsidian.md/t/meta-post-common-css-hacks/1978>\
**Category:** Themes & CSS snippets\
**Tags:** custom-css\
**Created:** [June 16, 2020, 2:17pm UTC](https://forum.obsidian.md/t/meta-post-common-css-hacks/1978 "2020-06-16T14:17:57Z")\
**Posts on this page:** 1\
**Showing post:** 327

<div class="post-metadata">

**Author:** ![cmjn](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/c/49beb7/32.png) [@cmjn](https://forum.obsidian.md/u/cmjn)\
**Post date:** [February 26, 2021, 2:36pm UTC](https://forum.obsidian.md/t/meta-post-common-css-hacks/1978/327 "2021-02-26T14:36:18Z")

</div>

Hi, I like to find my tags easily within a page so I set up this css hack to have tags displayed on the right of my paragraph texts, with just a hashtag as marker within the paragraph.  
The tag itself is hidden, what is displayed is a ::before pseudo-element (as marker) and a ::after pseudo-element (as tag text in the right gutter). If you hover one of them the hovering is also applied to the other one.

You can adjust as you like. I attach screenshots of this minimal code and of further decoration I use in my own set up (with tag pills etc.), with preview on the left and editor on the right.

```
p > a.tag {
    font-size: 0;
    width: 0;
    padding: 0;
    margin: 0;
    background: none;
    text-decoration: none;
    border: none;
}
p > a.tag::before {
    content: '#';
    font-size: 16px;
}
p > a.tag::after {
    content: attr(href);
    float: right;
    min-width: 3ch;
    max-width: 25%;
    margin-right: calc(-25% - 1.5em);
    margin-left: calc(-25% - 1.5em);
    position: relative;
    clear: right;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font-size: 16px;
}

p > a.tag:hover::after {
    max-width: fit-content !important;
} 

```

 ![sidetags](https://forum.obsidian.md/uploads/default/original/2X/d/d12f002545f09ee9486ecdaa7879912be533f9b9.jpeg)

 ![sidetags2](https://forum.obsidian.md/uploads/default/original/2X/1/1cf2b3239a24f3b0c3176580c1d88fc0b4f43fec.jpeg)

---

_[View the full topic](https://forum.obsidian.md/t/meta-post-common-css-hacks/1978)._
