---
sourceDocument: Brazil Employee Service Management
sourceDocumentLink: https://www.servicenow.com/docs/r/employee-service-management

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Employee Service Management

ft:clusterId :

    - emplsm

bundleId :

    - emplsm

workflow :

    - Employee


---

# Editing source code in the Rich Content Editor

# Editing source code in the Rich Content Editor {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Editing source code in the Rich Content Editor

The Rich Content Editor in ServiceNow allows you to directly modify HTML and CSS source code for all elements in the canvas or for specific elements.
This capability lets you build layouts, add custom styling beyond the canvas interface, and migrate content by copy-pasting code from other sources.
Show full answer Show less  

## Key Features

* **Portal Security:** When applying changes, the editor automatically removes HTML tags that could compromise your instance, ensuring secure content.
* **Code Identification:** The editor highlights critical CSS fragments in red that should not be deleted because they are part of the portal theme or shared across multiple elements.
* **CSS Rule Management:** The editor removes unused CSS rules upon saving. If you try to delete a CSS rule that is still referenced by key elements (like Row, Cell, Canvas, Divider, Button, Link block, or Tabs), the editor reinstates it. To override this, you can highlight the CSS and use the Remove CSS button to permanently delete the rule.
* **Enablement:** This feature is not enabled by default; an administrator must activate the Edit code property.

## Important Considerations

* Adding custom HTML and CSS can break your page design, so proceed cautiously.
* The Rich Content Editor does not reliably support undo operations for code changes, so be careful when editing.
* Avoid defining CSS rules using general HTML elements like \<div\> or \<p\> because this can cause unintended styling effects across the portal.
* Copy-pasting behavior may vary by browser. If Ctrl+V does not work as expected, use the duplicate icon in the component toolbar.
* If pasted content loses styling, clear the styling field and reapply styles manually.
* If pasted content appears different after saving, it may be due to script tags being removed by the HTML sanitizer.  
Modify the HTML and CSS source code for all the elements in the canvas or for a specific element.
Build the layout using HTML elements, directly edit the CSS for an element to add styling that isn't otherwise available in the canvas interface, or copy-paste code to migrate content from other sources.

## Features and capabilities {#rce-editing-source-code__section_bkj_vjc_f1c}

Ensure portal security
:   When you click Apply in the Edit code window, the code editor removes HTML tags that could be used to compromise your instance. For more information, see [HTML sanitizer](https://www.servicenow.com/docs/access?context=c_HTMLSanitizer&version=brazil&pubname=brazil-platform-security&ft:locale=en-US).

Identify important code
:   The editing window highlights CSS fragments in red if they should not be deleted. This indicates either a setting that is part of the portal theme or that multiple elements use that code.
:   Additionally, if you delete a CSS rule that is referenced by one of the following HTML elements, the code editor reinstates the CSS rule:

    * Row
    * Cell
    * Canvas
    * Divider
    * Button
    * Link block
    * Tabs
    {#rce-editing-source-code__ul_yx1_t1n_b1c}

Remove unnecessary code
:   When you save your changes, the code editor removes any unused CSS rules.
:   Conversely, if the code editor reinstates a CSS rule that you are trying to remove, highlight that block of CSS code and click the Remove CSS button to override the code editor.Figure 1. Example of using the Remove CSS button

    In the following video, the user tries to delete a CSS rule using the delete key, but the system reinstates the code. Next the user highlights the code and clicks Remove CSS, which successfully
removes the code.  
Note:  
This feature is not available by default. An Admin must enable the Edit code property. See [Properties installed with Content Publishing](https://www.servicenow.com/docs/L9ws2girAkEUJbN0D4Eupg "The Content Publishing [com.sn_content_delivery] plugin adds the following properties that are designed to control how scheduled jobs work in relation to notifications, to-dos, and communities.")

## Important considerations {#rce-editing-source-code__section_jv1_bzw_21c}

* Adding custom HTML and CSS can break your design. Proceed with caution when using this feature. The Rich Content Editor does not track changes in the code editor, so the Undo button will not reliably revert the code changes.
* We do not recommend using HTML elements (such as div or p) to define CSS rules, as that can have unintended consequences.Figure 2. Example of an unexpected outcome when using HTML element to define CSS rule

  In the following example, the user defines a CSS rule for the p element in a cell. However, in the page preview, the style rules apply to the p elements in all the text boxes, as well as in the footer.
* Different browsers may exhibit varying copy/paste behaviours. If pressing Ctrl+V does not duplicate the content as expected, click the duplicate icon in the component toolbar.
* If copy-pasted content does not retain its styling (such as font), and adjusting the settings does not help, clear the styling by clicking the "x" next to the styling field, then set the styling.![Remove the custom styling by clicking the "x" next to the styling field]()
* If pasted content appears differently saving, it likely due to some script tags being removed by the HTML sanitizer.
{#rce-editing-source-code__ul_vwx_czw_21c}

