Reduce spacing between variables.

mrreddy534
Tera Contributor

Hi experts, I need your help. I created a rich text label variable and a checkbox variable in a Catalog item, and I want to reduce the spacing between them. How can I do that?

4 REPLIES 4

ShubhamGarg
Kilo Sage

Hello @mrreddy534 ,

Can you try below steps & let me know if it helps?

To reduce the spacing between two variables on a ServiceNow Record Producer, you can use CSS styles to adjust the margin or padding of the elements that contain the variables.

Here's an example of how you can use CSS styles to reduce the spacing between a rich text label variable and a multiline text variable:

  1. Open the record producer that contains the two variables that you want to adjust the spacing for.

  2. Click on the "Variables" related list to see a list of all the variables on the record producer.

  3. Locate the variable that you want to reduce the spacing after (in this case, the rich text label variable).

  4. Click on the variable's name to open the variable form.

  5. In the "Attributes" section, add a new attribute called "Container CSS Style" with a value of "margin-bottom: 0;". This will remove the default bottom margin of the container element that holds the rich text label variable.

  6. Click "Update" to save the changes to the variable.

  7. Repeat steps 3-6 for the variable that you want to reduce the spacing before (in this case, the multiline text variable), but use "margin-top: 0;" instead of "margin-bottom: 0;" to remove the top margin of its container element.

If my response helps you in any way, kindly mark this as Accepted Solution/Helpful and help in closing this thread.

Regards,

Shubham

Hi @ShubhamGarg thanks for your response, for rich text variable there is no attributes section showing.

Have you found the solution ?

Stepan Kravciv
Tera Contributor

You can use inline CSS on rich text label

<p style="margin: -15px 30px -40px !important; padding: 0px !important; position: absolute !important;"><em>label</em></p>