# Questions related to hashtags \[CSS\]

**URL:** <https://forum.obsidian.md/t/questions-related-to-hashtags-css/4584>\
**Category:** Basement\
**Tags:** custom-css\
**Created:** [August 20, 2020, 8:37am UTC](https://forum.obsidian.md/t/questions-related-to-hashtags-css/4584 "2020-08-20T08:37:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![den](https://forum.obsidian.md/user_avatar/forum.obsidian.md/den/32/1932_2.png) [@den](https://forum.obsidian.md/u/den)\
**Post date:** [August 20, 2020, 8:37am UTC](https://forum.obsidian.md/t/questions-related-to-hashtags-css/4584/1 "2020-08-20T08:37:36Z")

</div>

1. How to color the tag in RIGHT TAG BAR, based on specific text? For example if there in tag `#important` I want it to be RED. There is no specific class for text content so I have no idea how to do it only in CSS

2. How to strip / remove the # from hashtags in the preview mode? it is possible purely in CSS?

🙏🏼

---

<div class="post-metadata">

**Author:** ![ryanjamurphy](https://forum.obsidian.md/user_avatar/forum.obsidian.md/ryanjamurphy/32/334_2.png) [@ryanjamurphy](https://forum.obsidian.md/u/ryanjamurphy)\
**Post date:** [August 20, 2020, 2:58pm UTC](https://forum.obsidian.md/t/questions-related-to-hashtags-css/4584/2 "2020-08-20T14:58:01Z")

</div>

> [@Meta Post - Common CSS Hacks](https://forum.obsidian.md/t/meta-post-common-css-hacks/1978/13):
>
> this worked for me : .tag[href="#important"] { color : red; } Tag Pills 0.73 [Obsidian\_7eMo0E8BFS] .tag { background-color: var(--text-accent); border: none; color: white; font-size: 11px; padding: 1px 8px; text-align: center; text-decoration: none; display: inline-block; margin: 0px 0px; cursor: pointer; border-radius: 14px; } .tag:hover { color: white; background-color: var(--text-accent-hover); } .tag[href^="#obsidian"] { background-color: #4d3ca6; } .tag[href^=…

Please try searching before posting new questions, thanks!

---

<div class="post-metadata">

**Author:** ![den](https://forum.obsidian.md/user_avatar/forum.obsidian.md/den/32/1932_2.png) [@den](https://forum.obsidian.md/u/den)\
**Post date:** [August 20, 2020, 3:04pm UTC](https://forum.obsidian.md/t/questions-related-to-hashtags-css/4584/3 "2020-08-20T15:04:17Z")

</div>

This I know. I post the “Pills” tag before it become popular.

> [@Meta Post - Common CSS Hacks](https://forum.obsidian.md/t/meta-post-common-css-hacks/1978/33):
>
> Put country flags when you are using hashtag of ISO language code. You need to do it manually for each language. Examples: Czech language .tag[href="#cze"]{ background: #b5fbac; text-shadow: 20px 20px 60px #9ad592, -20px -20px 60px #d0ffc6; color: black; } .tag[href="#cze"]:before { color: white; content: "czech_republic"; padding: -20pt -20pt 15pt 5pt; margin: 0pt; font-size: 15pt; } .tag[href="#cze"]:hover { border-radius: 14px; ba…

But I want to color the tags in right side of the bar, in list generated by Tag.

---

<div class="post-metadata">

**Author:** ![ryanjamurphy](https://forum.obsidian.md/user_avatar/forum.obsidian.md/ryanjamurphy/32/334_2.png) [@ryanjamurphy](https://forum.obsidian.md/u/ryanjamurphy)\
**Post date:** [August 20, 2020, 3:07pm UTC](https://forum.obsidian.md/t/questions-related-to-hashtags-css/4584/4 "2020-08-20T15:07:21Z")

</div>

Ah, sorry. Switched back to an open #help issue.

You might want to ask in the Discord, as the css-themes channel there is a bit busier than CSS discussions on this forum.

---

<div class="post-metadata">

**Author:** ![Silver](https://forum.obsidian.md/user_avatar/forum.obsidian.md/silver/32/5_2.png) [@Silver](https://forum.obsidian.md/u/Silver)\
**Post date:** [August 27, 2020, 10:40am UTC](https://forum.obsidian.md/t/questions-related-to-hashtags-css/4584/5 "2020-08-27T10:40:45Z")

</div>

> [@den](#):
>
> How to color the tag in RIGHT TAG BAR, based on specific text? For example if there in tag `#important` I want it to be RED. There is no specific class for text content so I have no idea how to do it only in CSS

We’ll need to add either a `title` or `href` attribute for this to work. Unlinke tags in preview, tags in the tag pane don’t have a `href` yet.

> [@den](#):
>
> How to strip / remove the # from hashtags in the preview mode? it is possible purely in CSS?

I thought `:first-letter` would work, but unfortunately it doesn’t. `#` is not considered to be a letter by CSS spec.

So for both of these to work, we’ll need to make changes on our end.

Are you trying to make a new theme, if I may ask?

---

<div class="post-metadata">

**Author:** ![den](https://forum.obsidian.md/user_avatar/forum.obsidian.md/den/32/1932_2.png) [@den](https://forum.obsidian.md/u/den)\
**Post date:** [August 28, 2020, 6:02am UTC](https://forum.obsidian.md/t/questions-related-to-hashtags-css/4584/6 "2020-08-28T06:02:07Z")

</div>

I already made a custom theme, but unfortunately it isn’t in state that I can publish it. In Discord I was looking for somebody who I can handover this theme, that he will clean the code a bit and some variables for dark / light mode.

And yes, I want to incorporate this in the theme, to make it bit more clean. It is obvious that they are hashtags so I don’t need to see #.

 ![Screenshot 2020-08-28 at 20.32.58](https://forum.obsidian.md/uploads/default/original/2X/f/f121ff79e9f06fc9d55e4273f346842ac9b6c2a4.jpeg)

---

<div class="post-metadata">

**Author:** ![Mayonnaise2124](https://forum.obsidian.md/user_avatar/forum.obsidian.md/mayonnaise2124/32/20949_2.png) [@Mayonnaise2124](https://forum.obsidian.md/u/Mayonnaise2124)\
**Post date:** [August 28, 2020, 3:23pm UTC](https://forum.obsidian.md/t/questions-related-to-hashtags-css/4584/7 "2020-08-28T15:23:55Z")

</div>

It is possible in edit mode:

```css
.cm-hashtag-begin {
    display: none;
}

```

But I don’t think it’s possible in Preview.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [April 1, 2023, 1:50pm UTC](https://forum.obsidian.md/t/questions-related-to-hashtags-css/4584/8 "2023-04-01T13:50:04Z")

</div>

Closed on April 1, 2023, 1:50pm UTC


