# Styling internal links with a different color

**URL:** <https://forum.obsidian.md/t/styling-internal-links-with-a-different-color/71489>\
**Category:** Devs: Theme Design & Custom CSS\
**Created:** [November 18, 2023, 2:12am UTC](https://forum.obsidian.md/t/styling-internal-links-with-a-different-color/71489 "2023-11-18T02:12:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![woofy31](https://forum.obsidian.md/user_avatar/forum.obsidian.md/woofy31/32/57279_2.png) [@woofy31](https://forum.obsidian.md/u/woofy31)\
**Post date:** [November 18, 2023, 9:49am UTC](https://forum.obsidian.md/t/styling-internal-links-with-a-different-color/71489/2 "2023-11-18T09:49:42Z")

</div>

OK, so here’s what I came up with (via a custom CSS snippet, no plugins whatsoever):

```css
/* target external links in ALL views */
body {
  --link-external-color: blue;
  --link-external-color-hover: blue;
}

/* revert undesired edit-mode external link parenthesis coloring */
.cm-s-obsidian span.cm-url.cm-formatting-link-string {
  color: var(--text-faint);
}

/* target both internal WIKI links & MD links in ALL views */
.cm-s-obsidian span.cm-hmd-internal-link,
.cm-s-obsidian span.cm-url:has([data-link-path$="md"]),
.cm-s-obsidian span.cm-link:has([data-link-path$="md"]),
.cm-s-obsidian span.cm-link:has([data-link-path$="md"]) .cm-underline:hover,
.markdown-rendered .internal-link
{
  color: red;
}

```

Result in source mode:

> ![Screenshot-18_11_2023-11.49.49](https://forum.obsidian.md/uploads/default/original/3X/2/9/29250459737c10cbd08c328d4cb282eb74d68145.jpeg)

Result in Live Preview & Reading mode:

> ![Screenshot-18_11_2023-11.49.55](https://forum.obsidian.md/uploads/default/original/3X/4/7/470d626cbfe16d86c6824d872ca5fb250fd34e90.jpeg)

---

_[View the full topic](https://forum.obsidian.md/t/styling-internal-links-with-a-different-color/71489)._
