Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Adding border on all pictures in knowledge articles using stylesheets

MOKRA
Tera Contributor

Hi.

Is there a way to edit / apply a css stylesheet to all knowledge articles in a knowledge base?

 

For example, we would like to have a border around all our images used in KB articles, and so far we have been adding these manually via picture editing software which is a tedious and time consuming task, and especially if the images needs to be resized afterwards.

 

I've found the following that talks a little about it ( How to change the CSS for Knowledge Articles - Support and Troubleshooting (servicenow.com) ).

But since I do not have admin access to look around and fiddle with this in our ServiceNow instances and our ServiceNow admin team is very pressured with tasks I would like to know exactly where to find and edit / add a css stylesheet that can be applied to all knowledge article so that by default all images have a 2pixel colored border added on them. (both existing and new articles).

 

Is this even possible and can you point me to where to find and edit this so that I can send the request to our internal ServiceNow team fully documented on where and how to change this.

 

Example of what it looks like:

blue border.PNG

1 ACCEPTED SOLUTION

Nicole McCleaf
Tera Expert

Hi @MOKRA: There is a CSS file on the backend that can be updated. You just need to add something like the following to the stylesheet.

img {

  border: 1px solid #000;

}

 

See How to change the CSS for Knowledge Articles.

 

Then, alternatively,  if you have an image in an article where you don't want a border, you just place "0" in the Insert/Edit image > Advanced > Border width field.

 

Hope this helps!

View solution in original post

4 REPLIES 4

Peter Bodelier
Giga Sage

Hi @MOKRA,

 

Are you using the backend for your knowledge bases, or just a Service Portal?


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

We are using both backend and portal also

Nicole McCleaf
Tera Expert

Hi @MOKRA: There is a CSS file on the backend that can be updated. You just need to add something like the following to the stylesheet.

img {

  border: 1px solid #000;

}

 

See How to change the CSS for Knowledge Articles.

 

Then, alternatively,  if you have an image in an article where you don't want a border, you just place "0" in the Insert/Edit image > Advanced > Border width field.

 

Hope this helps!

Do you by any chance now where this CSS file is located and if it will affect both backend and frontend/portal?