How can I set up Heading style and Field style in my article templates?

Tele
Kilo Contributor

Hello,

How can I set up Heading style and Field style in my article templates?

Thank you much

6 REPLIES 6

Willem
Giga Sage
Giga Sage

Hi Tele,

You can do it as follows:

Go to Knowledge -> Administration -> Article Templates and select one that you like to set the Heading and Article template for. Select Article Template Field like below:

find_real_file.png

 

Clicking Question for example you can add CSS for the Heading style or Field style:

find_real_file.png

 

Example CSS:

Set the font size as 40 pixels:

font-size: 40px;

 

You can find more on it here:

Heading style CSS formats applied to the template header. For example, to display the background of the template header in red, with a 24-px font size, Arial font family, and white text color, enter the following code: background-color:red; font-size:24px; font-family:Arial; color:white;
Field style CSS formats applied to the template fields. Any CSS format applied at the field level is automatically applied to the header if not already specified in the Heading style field. For example, to display the 300px page width, 25px solid green border, 25px padding, and 25px page margin, enter the following code: width:300px; border:25px solid green; padding:25px; margin:25px;

 

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/product/knowledge-management/task...

Albert6
Tera Contributor

Hi Willem. Is it possible add CSS class (for example Bootstrap class) to field style? and in the article template, when preparing content put reference tag to this CSS class or it is only limited to key (width) and value (300px).
Something like this:

.alert-urgent

{

background-color: #F9D3D3;

width: 100%;

}

Shiksha1
Tera Contributor

Hi Willem 

 

I tried adding field style to article template field as below.

Shiksha1_0-1684228326521.png

But styling not visible on article form as per attached below:

Shiksha1_1-1684228510770.png

kindly suggest

amber_km
Tera Contributor

The issue I'm running into is that the Header and Field BOTH indent when I put padding and margin only in the Field style box. I only want the field to be indented. How do I fix this? Thanks!