# Style ALL \<a\>'s sitewide

**URL:** <https://forum.wixstudio.com/t/style-all-a-s-sitewide/36537>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [September 16, 2020, 4:52am UTC](https://forum.wixstudio.com/t/style-all-a-s-sitewide/36537 "2020-09-16T04:52:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wix47224](https://avatars.discourse-cdn.com/v4/letter/w/fbc32d/32.png) [@wix47224](https://forum.wixstudio.com/u/wix47224)\
**Post date:** [September 16, 2020, 4:52am UTC](https://forum.wixstudio.com/t/style-all-a-s-sitewide/36537/1 "2020-09-16T04:52:17Z")

</div>

Maybe I’m missing something, but I can’t find a way to do this.  
I’d like to colour all links blue by default.  
I don’t see any settings to do it.

I don’t think we can add CSS to the code area.

I tried this (and other variations of this code) with no joy.

```javascript
//this function is called from $w.onReady  
function fixLinks() {
 let textElements = $w("Text");
 for (var t of textElements){
        console.log(t.html);
        t.html.replace(/<a/g, '<a style="background-color:#ff0000;text-decoration:underline;"');

    }
}

```

Surely there must be a way to turn all links site-wide blue…?

TIA…

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [September 16, 2020, 5:25am UTC](https://forum.wixstudio.com/t/style-all-a-s-sitewide/36537/2 "2020-09-16T05:25:00Z")

</div>

You are correct in stating " I don’t think we can add CSS to the code area."

If you want to customize links, you could use the [Text](https://www.wix.com/corvid/reference/$w/text/introduction) screen element and use the available [HTML and styling](https://www.wix.com/corvid/reference/$w/text/introduction) .

---

<div class="post-metadata">

**Author:** ![wix47224](https://avatars.discourse-cdn.com/v4/letter/w/fbc32d/32.png) [@wix47224](https://forum.wixstudio.com/u/wix47224)\
**Post date:** [September 16, 2020, 2:20pm UTC](https://forum.wixstudio.com/t/style-all-a-s-sitewide/36537/3 "2020-09-16T14:20:57Z")

</div>

Thanks @yisrael-wix - can you explain why my code above doesn’t work? I know I can go through with the editor and manually change the colour of each link. But that is a bit silly if say next week we want to change ALL links to a different shade of blue. Or red. On a big site that could take hours, and one or two would probably get missed. What I’m looking for is a simple way to style EVERY link on EVERY page with a couple of lines of code. Like you can do with CSS on a regular site. Or jquery.

---

<div class="post-metadata">

**Author:** ![wix47224](https://avatars.discourse-cdn.com/v4/letter/w/fbc32d/32.png) [@wix47224](https://forum.wixstudio.com/u/wix47224)\
**Post date:** [September 17, 2020, 4:43pm UTC](https://forum.wixstudio.com/t/style-all-a-s-sitewide/36537/4 "2020-09-17T16:43:28Z")

</div>

@yisrael-wix any thoughts on how to style EVERY link on the site so it can be changed easily as the design changes? Without manually going through every link, or having to have separate code for every link? This code should work, according to your answer to another post, but it does nothing - am I missing something?

```javascript
//this function is called from $w.onReady  
function fixLinks() {
 let textElements = $w("Text");
 for (var t of textElements){
        console.log(t.html);
        t.html.replace(/<a/g, '<a style="background-color:#ff0000;text-decoration:underline;"');

    }
}

```
