I'm trying to add a small rectangle filled with color to the inside of a dropdown menu but it's not working. Ideally the option would looks like "red |||||" where the |||| would be a red rectangle. Here is the relevant HTML that isn't working (I'm aware that it currently makes all the rectangles red):
<select class="bootstrap-select btn" name="colorSelect">
<option name="name0" value="0" >red<span class="colorRectangle"></span></option>
<option name="name1" value="1" >green<span class="colorRectangle"></span></option>
<option name="name2" value="2" >blue<span class="colorRectangle"></span></option>
</select>
And CSS:
.colorRectangle{
width:30px;
height:20px;
background:red;
}