<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using panel id to change background color of panel in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-panel-id-to-change-background-color-of-panel/m-p/497806#M32589</link>
    <description>&lt;P&gt;I'm looking at the answers provided from the links &lt;A href="https://answers.splunk.com/answers/588250/how-can-i-add-html-and-background-colors-in-a-dash.html"&gt;1&lt;/A&gt; and &lt;A href="https://answers.splunk.com/answers/407832/how-to-change-panel-background-color-using-css.html?utm_source=typeahead&amp;amp;utm_medium=newquestion&amp;amp;utm_campaign=no_votes_sort_relev"&gt;2&lt;/A&gt; at the bottom of this page, and they both mention using panel id to specify the background color of a panel. I have 5 panels in all, and I was able to change the background color of the 5 panels with the code below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;row depends="$STYLES$"&amp;gt;
     &amp;lt;panel&amp;gt;
       &amp;lt;html&amp;gt;
         &amp;lt;style&amp;gt;
           #panel_section1 .dashboard-panel {
             background:green !important;
           }
           #panel_section2 .dashboard-panel {
             background:green !important;
           }
           #panel_section3 .dashboard-panel {
             background:green !important;
           }
           #panel_section4 .dashboard-panel {
             background:green !important;
           }
           #panel_section5 .dashboard-panel {
             background:green !important;
           }
         &amp;lt;/style&amp;gt;
       &amp;lt;/html&amp;gt;
     &amp;lt;/panel&amp;gt;
   &amp;lt;/row&amp;gt;
 ...
&amp;lt;row&amp;gt;
 &amp;lt;panel id="panel_section1"&amp;gt;
   ...
 &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;
&amp;lt;row&amp;gt;
 &amp;lt;panel id="panel_section2"&amp;gt;
   ...
 &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;

(3 more times for section3 to section5).
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My question is I wanted the same style for all my panels, i.e. background is green. Do I really have to repeat the code 5 times for 5 panels? I tried the code below and it did not work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;style&amp;gt;
    #panel_section1 #panel_section2 #panel_section3 #panel_section4 #panel_section5 .dashboard-panel {
      background:green !important;
  }
&amp;lt;style&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also tried the code below, i.e. only have 1 &lt;CODE&gt;&amp;lt;style&amp;gt;&lt;/CODE&gt; block and set all my panels to the same id, but got the error that there was duplicate panel id.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;style&amp;gt;
    #panel_section1 .dashboard-panel {
      background:green !important;
  }
&amp;lt;style&amp;gt;
...
&amp;lt;row&amp;gt;
 &amp;lt;panel id="panel_section1"&amp;gt;
   ...
 &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;
&amp;lt;row&amp;gt;
 &amp;lt;panel id="panel_section1"&amp;gt;
   ...
 &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm just wondering if there is a shorter and less repetitive way to do this.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2019 09:54:01 GMT</pubDate>
    <dc:creator>wu_weidong</dc:creator>
    <dc:date>2019-12-06T09:54:01Z</dc:date>
    <item>
      <title>Using panel id to change background color of panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-panel-id-to-change-background-color-of-panel/m-p/497806#M32589</link>
      <description>&lt;P&gt;I'm looking at the answers provided from the links &lt;A href="https://answers.splunk.com/answers/588250/how-can-i-add-html-and-background-colors-in-a-dash.html"&gt;1&lt;/A&gt; and &lt;A href="https://answers.splunk.com/answers/407832/how-to-change-panel-background-color-using-css.html?utm_source=typeahead&amp;amp;utm_medium=newquestion&amp;amp;utm_campaign=no_votes_sort_relev"&gt;2&lt;/A&gt; at the bottom of this page, and they both mention using panel id to specify the background color of a panel. I have 5 panels in all, and I was able to change the background color of the 5 panels with the code below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;row depends="$STYLES$"&amp;gt;
     &amp;lt;panel&amp;gt;
       &amp;lt;html&amp;gt;
         &amp;lt;style&amp;gt;
           #panel_section1 .dashboard-panel {
             background:green !important;
           }
           #panel_section2 .dashboard-panel {
             background:green !important;
           }
           #panel_section3 .dashboard-panel {
             background:green !important;
           }
           #panel_section4 .dashboard-panel {
             background:green !important;
           }
           #panel_section5 .dashboard-panel {
             background:green !important;
           }
         &amp;lt;/style&amp;gt;
       &amp;lt;/html&amp;gt;
     &amp;lt;/panel&amp;gt;
   &amp;lt;/row&amp;gt;
 ...
&amp;lt;row&amp;gt;
 &amp;lt;panel id="panel_section1"&amp;gt;
   ...
 &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;
&amp;lt;row&amp;gt;
 &amp;lt;panel id="panel_section2"&amp;gt;
   ...
 &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;

(3 more times for section3 to section5).
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My question is I wanted the same style for all my panels, i.e. background is green. Do I really have to repeat the code 5 times for 5 panels? I tried the code below and it did not work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;style&amp;gt;
    #panel_section1 #panel_section2 #panel_section3 #panel_section4 #panel_section5 .dashboard-panel {
      background:green !important;
  }
&amp;lt;style&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also tried the code below, i.e. only have 1 &lt;CODE&gt;&amp;lt;style&amp;gt;&lt;/CODE&gt; block and set all my panels to the same id, but got the error that there was duplicate panel id.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;style&amp;gt;
    #panel_section1 .dashboard-panel {
      background:green !important;
  }
&amp;lt;style&amp;gt;
...
&amp;lt;row&amp;gt;
 &amp;lt;panel id="panel_section1"&amp;gt;
   ...
 &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;
&amp;lt;row&amp;gt;
 &amp;lt;panel id="panel_section1"&amp;gt;
   ...
 &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm just wondering if there is a shorter and less repetitive way to do this.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 09:54:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Using-panel-id-to-change-background-color-of-panel/m-p/497806#M32589</guid>
      <dc:creator>wu_weidong</dc:creator>
      <dc:date>2019-12-06T09:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using panel id to change background color of panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-panel-id-to-change-background-color-of-panel/m-p/497807#M32590</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; #panel_section1 .dashboard-panel,#panel_section2 .dashboard-panel {
              background:green !important;
            }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;style&amp;gt;
            [id^="panel_section"] .dashboard-panel {
              background:green !important;
            }

          &amp;lt;/style&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Dec 2019 12:54:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Using-panel-id-to-change-background-color-of-panel/m-p/497807#M32590</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-12-06T12:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using panel id to change background color of panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-panel-id-to-change-background-color-of-panel/m-p/497808#M32591</link>
      <description>&lt;P&gt;Thanks! This worked.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 01:34:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Using-panel-id-to-change-background-color-of-panel/m-p/497808#M32591</guid>
      <dc:creator>wu_weidong</dc:creator>
      <dc:date>2019-12-24T01:34:24Z</dc:date>
    </item>
  </channel>
</rss>

