The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

How can I edit my Stylesheet so that only my external links appear as blue and underscored?

Deleted user
March 3, 2021

Our wiki has a style applied that makes every link (both internal confluence page links and external links) to be red with no underscore. I'd like to retain this except for external links, which I want to appear as blue with an underscore. I currently have this applied to my stylesheet:

.wiki-content a { text-decoration:underline !important; color:blue !important; }  

 

However, the "!important" overrides all of my links. I only want this change to apply to specific links in my space, the external links. Is this possible? If so, how should I edit the above?

Thank you!

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Brant Schroeder
Community Champion
March 3, 2021

You should be able to do something like this

/* add this to css and add your sites url and remove mysite.com */ a[href*="//"]:not([href*="mysite.com"]) { text-decoration:underline !important; color:blue !important; }

Deleted user
March 15, 2021

Thank you! Here is what I ended up doing, it's probably a little convoluted but it worked:

 

/* Global change override - Changes internal links back to red without underscore */  
.wiki-content a[href*="/display/"] { color: #A52A2A !important; text-decoration:none !important}   

  

/* Global change override - Changes internal links back to red without underscore */  
.wiki-content a[href*="pages/"] { color: #A52A2A !important; text-decoration:none !important}   

  

/* Global change override - Changes Table of Contents back to red without underscore */
.wiki-content a[class*="toc-link"] { color: #A52A2A !important; text-decoration:none !important}   

  

/* Global change override - Changes user mention background color so that it is readable */
.wiki-content a.user-mention.current-user-mention { background-color: #87CEFA !important; }   

  

/* Global change so that all links are blue with an underscore */  
.wiki-content a { text-decoration:underline !important; color:blue !important; }  

TAGS
AUG Leaders

Atlassian Community Events