Dashboards & Visualizations

Why doesn't CSS work in dashboards?

rendie
Path Finder

Hi,
I use this example in my dashboard on local splunk this work:
alt text
But if I use this example in Splunk on Google Cloud Platform, then css doesn't work.
How to fix it?

0 Karma

anthonymelita
Contributor

I'm just discovering the same issue today an found in the release notes that Splunk broke CSS in 7.3.3. This also breaks in-line CSS which I have yet to figure out how to fix.

Uncategorized issues
Date filed  Issue number    Description
2019-12-03  SPL-180371, SPL-175319  CSS outside of <html> tag in SimpleXML doesn't work

Workaround:
Add <style> tag inside of <html> tag, with <p /> in front of the style tag:
<dashboard>
    <label>built-in css</label>
    <row>    
        <panel>      
            <html>
                <p/>
                <style>#text {background: red;}</style>        
                <div id="text">text with red background</div>
            </html>    
        </panel> 
    </row>
</dashboard>

kamlesh_vaghela
SplunkTrust
SplunkTrust

@rendie
Any error you seen in browser console? Can you please share more information like Splunk Version in local and cloud?

0 Karma

rendie
Path Finder

@kamlesh_vaghela No error. Splunk Local is 7.3.1.1, Splunk on Cloud 7.3.3

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...