Background color change according to attribute

624
2
Jump to solution
11-12-2021 02:13 AM
Labels (1)
PSGeo1
by
New Contributor III

Hi,

I got to this post Match-Popup-to-Map-Value.md . that explains how to change the color of the text according to the attribute.

I was trying to do the same for background. 

my arcade code is exactly the same as in the post. 

my original html code:

<div style="padding:5px;background-color:rgb(31, 209, 70)"><b>Region</b></div>
<table style="width:100%;">

And this is my failed attempt...

<div style="padding:5px;background-color:"{expression/expr0}"><b>Region</b></div>
<table style="width:100%;">

 

any help is welcome.

cheers

P

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

In your attempt, you've got an extra quotation mark in the style tag. You'll want the expression to be within the quotes with everything else. Try this:

<div style="padding:5px;background-color:{expression/expr0}"><b>Region</b></div>
<table style="width:100%;">

 

- Josh Carlson
Kendall County GIS

View solution in original post

2 Replies
jcarlson
MVP Esteemed Contributor

In your attempt, you've got an extra quotation mark in the style tag. You'll want the expression to be within the quotes with everything else. Try this:

<div style="padding:5px;background-color:{expression/expr0}"><b>Region</b></div>
<table style="width:100%;">

 

- Josh Carlson
Kendall County GIS
PSGeo1
by
New Contributor III

thx!!! cheers

0 Kudos