Static HTML Content Block Background Color

JosephW1
Tera Guru

Hello,

How do I change the entire background of a Static HTML content block's widget? The background of the whole widget.

Thank you for your time!

Kind Regards,
Joseph

1 ACCEPTED SOLUTION

JosephW1
Tera Guru

I found a few non-invasive ways of doing this.

 

This method adds a colored container and works with both static and dynamic content blocks.

<style>
 .myContainer {
  background: #3399FF;
  width: 100%;
  height: 100%;
  position: absolute; //These last 3 are necessary
  top: 0;             //or else a thin white ribbon
  left: 0;            //will be around the perimeter.
 }
</style>
<div class="myContainer">
 <!-- Your Contents Here -->
</div>

 

Alternatively, here is a method using jQuery to change the widget's actual background's color. This only works in dynamic content blocks, not static ones.

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<script>
	<!-- Set Background Color -->
	$j('#myDisplay').closest('[data-uuid]').children(':first').css('background', '#3399FF');
</script>
	
<div id="myDisplay">
	<!-- Your Contents Here -->
</div>

</j:jelly>

 

Those two code sections produce the following result, assuming you hid the widget's header. (Which is my intention anyhow for this visual, as no widget header belongs in my use case.)

find_real_file.png

I hope that helps someone out!

Kind Regards,
Joseph

View solution in original post

11 REPLIES 11

Maik Skoddow
Tera Patron
Tera Patron

Hi @JosephW ,

which kind of "page" do you mean? A Dashboard? A Service Portal Page? A UI Page?

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

Hi Maik,

Do I need to change the page's background? I just want to change the Static HTML Content Block widget's entire background. If I place it on a dashboard, I want the entire widget's background to be a solid color other than the default white.

Thanks,
Joseph

Hi @JosephW ,

thanks for the clarification and I'm afraid it is not possible to change the background color of widgets.

But feel free to raise an Enhancement Request at idea portal. I can image, that there is already one request opened because many users have asked the same question before.

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

Thanks! Is this limitation also present in dynamic content blocks? Are they able to overcome this limitation since they are able to run code?