# Apply custom CSS to certain pages

**URL:** <https://forum.obsidian.md/t/apply-custom-css-to-certain-pages/15361>\
**Category:** Devs: Theme Design & Custom CSS\
**Tags:** custom-css\
**Created:** [March 27, 2021, 12:51am UTC](https://forum.obsidian.md/t/apply-custom-css-to-certain-pages/15361 "2021-03-27T00:51:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![angelFrog](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/a/e9a140/32.png) [@angelFrog](https://forum.obsidian.md/u/angelFrog)\
**Post date:** [March 27, 2021, 12:51am UTC](https://forum.obsidian.md/t/apply-custom-css-to-certain-pages/15361/1 "2021-03-27T00:51:33Z")

</div>

I have some pages with prose where in preview mode I don’t want to be distracted by any link colours. I can modify the CSS to produce the effect I want globally, but I’d like to apply the CSS only to certain pages.

One route I’ve considered is applying the effect only to pages with a certain tag, but I’m not sure if this is possible.

Thanks!

---

<div class="post-metadata">

**Author:** ![angelFrog](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/a/e9a140/32.png) [@angelFrog](https://forum.obsidian.md/u/angelFrog)\
**Post date:** [March 27, 2021, 5:01pm UTC](https://forum.obsidian.md/t/apply-custom-css-to-certain-pages/15361/2 "2021-03-27T17:01:34Z")

</div>

Ah, answers were available elsewhere if only I knew how to look 🙂

For any page that I want to mark as prose I insert this at the to to define the cssclass:

```
---
cssclass: prose
---

```

Then in the css snippets file (or in a css theme file):

```
.prose a {
  color: var(--text-normal);
  text-decoration: none !important;
}

```

In this case, I’m setting the link colour to normal text colour and removing the underline. Links will still change colour when I hover over them.

As a bonus, I can have links appear when text is selected with:

```
.prose a::selection {
  color: var(--text-accent-selected);
}

```

It’s scary how much Obsidian can be customized. Enough to keep me from doing real work!

---

<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:41pm UTC](https://forum.obsidian.md/t/apply-custom-css-to-certain-pages/15361/3 "2023-04-01T13:41:36Z")

</div>

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


