0

I have this code :

<select name="color" selected="selected" id="color"  style="width:100px;">
<option>colors</option>

php :-

    if(isset( $_GET['size']) ) {
  $size = $_GET['size'];
  }

  $query = "SELECT color FROM product_attr WHERE size='".$size."' AND `quantity`!='0'"; 
  $result = mysql_query($query);
    while ($query_row = mysql_fetch_array($result)) {

      echo "<option style='background-color:$query_row[0]' value ='".$query_row[0]."'></option> ";
      }

it works fine and i get every <option> with its color as a background but the only issue is that the hover effect of the mouse on the <option> makes the colors looking bad kinda and i don't know how to remove it! any suggestions? thanks in advance

user2869402
  • 27
  • 1
  • 8
  • Don't know if this will work `option:hover{background-color: transparent}` – Morpheus Nov 01 '13 at 16:01
  • it is not working dear – user2869402 Nov 01 '13 at 16:05
  • 1
    **Danger**: You are using [an **obsolete** database API](http://stackoverflow.com/q/12859942/19068) and should use a [modern replacement](http://php.net/manual/en/mysqlinfo.api.choosing.php). You are also **vulnerable to [SQL injection attacks](http://bobby-tables.com/)** that a modern API would make it easier to [defend](http://stackoverflow.com/questions/60174/best-way-to-prevent-sql-injection-in-php) yourself from. – Quentin Nov 01 '13 at 16:20

1 Answers1

0

try

option {
    background:transparent; 
}

in your CSS

Sid M
  • 4,354
  • 4
  • 30
  • 50