
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2021 04:13 PM
I've been looking for ways to make our content a little fancier. I thought it may be helpful for us to share the HTML features we use. I have 2 that I will share:
Colored "note bubbles" that we use for NOTE, IMPORTANT, WARNING, etc (we have each type as a different color):
HTML:
<div style="padding: 0px; margin: 1em 10px; border: 2px solid #5C5C5C; border-radius: 15px; background-color: #ffc;">
<div style="font-weight: bold; font-variant: small-caps; padding: 2px 1em; margin: -2px 0px 0px -10px; width: auto; border-radius: 25px; border: 2px solid #5C5C5C; display: inline-block; background-color: #ebd691; color: #363613;"><span style="font-size: 10pt;">Note:</span></div>
<div style="padding: 5px 1em; margin: 0px; color: #363613;"><span style="font-size: 14pt; font-family: verdana, geneva;">[NOTE TEXT HERE]</span></div>
</div>
Expand/collapse sections (accordion) for a cleaner look (can default to expanded or collapsed):
Sub-Header 1 defaults to expanded, Sub-Header 2 defaults to collapsed - differences are noted in the HTML. I added the plus in the text to make it more intuitive:
HTML: Use <details open=""> for expanded or <details> for collapsed
<details>
<summary style="padding: 2px 6px; background-color: #ddd; border: none; box-shadow: 3px 3px 4px black; cursor: pointer; margin: 20px;"><span style="font-family: verdana, geneva; font-size: 14pt;"><strong><span style="color: #2f5597;"><span style="color: #003da5;">+Collapsible Sub-Header 1</span></span></strong></span></summary>
<p style="margin: 0in 0in 8pt 22.5pt; font-size: 14pt; font-family: verdana, geneva;"><span style="font-family: verdana, geneva; font-size: 14pt;">Collapse text here<br /></span><span style="font-family: verdana, geneva; font-size: 14pt;">Collapse text here<br /></span><span style="font-family: verdana, geneva; font-size: 14pt;">Collapse text here<br /></span><span style="font-family: verdana, geneva; font-size: 14pt;">Collapse text here<br /></span><span style="font-family: verdana, geneva; font-size: 14pt;">End of collapse section</span></p>
</details>
I know I have struggled with some of these. For example, the TOC button is greyed out and I can't find any info on it, so I use workarounds for various things. What cool HTML tricks can you share?
Solved! Go to Solution.
- Labels:
-
Knowledge Management
- 3,033 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2021 11:45 PM
This article describes how to use TOC in TinyMCE.
https://community.servicenow.com/community?id=community_blog&sys_id=ae29fcab1be6ec1038739979b04bcbb1...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2021 04:16 PM
This one is especially useful - thank you!!
- <abbr> = Abbreviation. Requires title attribute, creates underline, changes cursor and title attribute creates hover-over text.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 08:09 PM
Late to the conversation but I found this when looking for a solution to my problem. This was really helpful. This is how I have modified it to create a help box with:
- Rounded outline border
- An image on the left, and
- A list of resources on the right.
<div style="float: left; padding: 10px 10px 10px 10px; margin: 5px 0px 0px 10px; width: 80%; border-radius: 25px; border: 4px solid #0078a9; display: inline-block; color: #363613;">
<table style="border: none;">
<tbody>
<tr style="border: none;">
<td style="width: 13.469%; border: none;"><img style="font-family: verdana, sans-serif; font-size: 13.3333px;" src="sys_attachment.do?sys_id=2d802720db38a1d050283fd3e296197f" alt="littlecloud.jpg" width="119" height="119" /></td>
<td style="width: 87.8921%; border: none;">
<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
<li>Link 4</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
Looks like this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 11:18 AM
I'm late to this conversation as well but had a question...
How do you make the code easily available to insert into a kb article in ServiceNow? As we all know, if it isn't easy, it won't get done!
And, maybe on the same thread as the TOC, is it possible to customize the built-in styles on the Tiny MCE toolbar? I was thinking that would be a great place to have the HTML code built-in and easily apply to text.
We are on the Tokyo release so have version 5 of the Tiny MCE tools - if that matters.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 03:22 PM
I created an autofill template with all the html features we created all in there so they can open a blank article side by side and copy paste the elements mostly without code. I also published articles that go into more detail about these features and included examples and code they can copy/paste. I don't know any way to automate these things using the TinyMCE toolbar.