Discover a clever way to set the background color of a selected HTML option element
This technique is effective for Chrome and Mozilla browsers.
The creator utilizes the following code:
<select multiple="" class="form-control">
<option>Option One</option>
<option>Option Two</option>
<option>Option Three</option>
<option>Option Four</option>
<option>Option Five</option>
</select>
select option:checked {
color: white;
background: #f26532 repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAYCAYAAAAMAljuAAAMFGlDQ1BJQ0MgUHJvZmlsZQAASImVVwdUk8kWnr+kEBJaIBQpoTdBepXei4B0sBGSAKEESAgqdnRRwbWgYsGKroIouhZA1ooFC4uAvT4QQVlZFwtYUHmTArq+dt49Z/75cufeO9+d3JkzA4CiDSsvLxtVAiCHXyCIDvJlJiYlM0ndAAM6QB6oA10WW5jnExUVDqCM9X+X4TsAEfc3rcSx/nX8v4oyhytkA4BEQZzKEbJzID4OAK7BzhMUAEBohXrD2QV5YjwIsaoAEgSAiItxuhRriHGqFE+U2MRG+0HsDQCZymIJ0gFQEPNmFrLTYRwFMUcbPofHh3gbxJ7sDBYH4kcQT8zJyYVYkQyxWep3cdL/FjN1PCaLlT6OpblIhOzPE+Zls+b+n8vxvyUnWzQ2hwFs1AxBcLQ4Z7hu1Vm5YWJMhfgUPzUiEmIViK/wOBJ7MX6QIQqOk9kPsIV+cM0AAwAUcFj+YRBrQ8wQZcX5yLAdSyDxhfZoBK8gJFaGUwW50bL4aCE/OyJcFmdFBjdkDO/gCgNixmzSeIEhEMNKQ48XZcQmSHmiFwt58REQK0DcLsyKCZP5PinK8IsYsxGIosWcjSB+lyYIjJbaYBo5wrG8MGs2SzIXrAXMuyAjNljqiyVyhYnhYxw4XP8AKQeMw+XHybhhsLp8o2W+JXnZUTJ7bAc3Oyhaus7YEWFhzJhvZwEsMOk6YE8zWaFRsrmG8wqiYqXccBSEAz/gD5hABFsqyAWZgNc20DAAf0lHAgELCEA64AIrmWbMI0EywoffGFAE/oSIC4Tjfr6SUS4ohPov41rp1wqkSUYLJR5ZoA/iHFwL98Td8XD49YbNDnfBXcf8mIpjsxIDiP7EYGIg0XycBxuyzoZNAHj/RhcGey7MTsyFP5bDt3iEPkIH4SnhNqGLcB/Eg2eSKDKrWbxiwQ/MmWAK6ILRAmXZpX6fHW4CWTvivrgH5A+54wxcC1jhDjATH9wL5uYItd8zFI1z+7aWP84nZv19PjK9goWCo4xF6vg/4zdu9WMUv+/WiAP7sB8tsRXYMawFO49dxU5hDYCJncUasVbstBiPV8IzSSWMzRYt4ZYF4/DGbGxqbfptPv8wN0s2v3i9hAXcOQXizeCXmzdXwEvPKGD6wNOYywzhs60nMu1sbJ0BEJ/t0qPjLUNyZiOMa990+ecAcC2FyvRvOpYhACf7AKAPf9MZvoHlvhaA0+1skaBQqhMfx4AAKEAR7gpNoAsMgRnMxw44AXfgDQJAKIgEsSAJ...
To generate the background data image, utilize this data URL maker tool to convert an image file with color (in this case, an orange image) to a data URL format. Then, paste the generated code within the specified location.
This method has been tested and verified as functional!