How to set different color in a select box due to selection with css

You can achieve this by adding an onchange event to your select tag.
Try the code below:

HTML:
<select id=”derselect” onchange=”this.className=this.options[this.selectedIndex].className”
class=”green”>
  <option class=”green”>Test 1
  <option class=”red”>Test 2
</select>

And your CSS:
.green { color:green}
.red {color:red}

🙂

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)