The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to make a reference to a CSS file?

Andrew Pishchul
Giga Expert

Guys,
do you know how to make a reference to a CSS file in UI page? I tried several options with

 <link type="text/css" href="...
, but with no success. I want to upload CSS file to SN instance and 'link' it to UI page.

- Andrew
1 ACCEPTED SOLUTION

jfarrer
Mega Guru

To upload CSS to ServiceNow you can go to Content Management -> Design -> Style Sheets, then upload the CSS. You'll be copying and pasting it in as a local stylesheet. Once it's defined as a stylesheet it can be referenced by a CMS Theme for use on a CMS site or you can reference directly in the HTML of a UI Page.

To reference it in your UI Page you need to add this to the page:



<link href="sys_id_of_stylesheet_record.cssdbx" rel="stylesheet" type="text/css"></link>

You'll need to replace "sys_id_of_stylesheet_record" with the Sys ID of the record you created.


View solution in original post

4 REPLIES 4

jfarrer
Mega Guru

To upload CSS to ServiceNow you can go to Content Management -> Design -> Style Sheets, then upload the CSS. You'll be copying and pasting it in as a local stylesheet. Once it's defined as a stylesheet it can be referenced by a CMS Theme for use on a CMS site or you can reference directly in the HTML of a UI Page.

To reference it in your UI Page you need to add this to the page:



<link href="sys_id_of_stylesheet_record.cssdbx" rel="stylesheet" type="text/css"></link>

You'll need to replace "sys_id_of_stylesheet_record" with the Sys ID of the record you created.


It works! Thanks!


It sure does, But it does have a cache issue. See this post here : http://chrishann.net/posts/2012/12/3/servicenow-style-sheets-and-caching

That's one of the right ways to do it.


This worked for me too.   Fixing some field justification issues in legacy surveys in Fuji.   Thanks for sharing.