How to wrap a option value in a css class in php?

There is code in the plugin
$val = $term->name;
 if ( ! isset( $term->level ) )
 $term->level = 0;
 $name = $style['show_terms']['separate_filter_boxes'] == 1 ? "a termset object[".$term->taxonomy."][]" : "termset_single";;
?>
 <option class="asp_option_cat asp_option_cat_level-<?php echo $term->level; ?>"
 asp_cat_parent="<?php echo $term->parent; ?>"
 value="<?php echo $term->term_id; ?>"
 <?php echo $selected ? "selected='selected'" : ""; ?>> 
 <?php echo str_repeat("&nbsp;&nbsp;", $term->level) . $val; ?>
</option>

<?php
$i++;
 }


need the option class drop-down list to style, I think you need it in a div class wrap. Or can advise something else?
now the standard is
5defbc0ba6951847534459.png
I want to make a
5defbc1fb688a341159904.png

Thanks in advance.
April 3rd 20 at 17:20
3 answers
April 3rd 20 at 17:22
Solution
Cross-browser styling select s is quite a challenge. In most cases, it makes sense to use special JavaScript libraries that actually replace select set div's. Such libraries very much. For Example, Chosen.
April 3rd 20 at 17:24
I think your question relates to php programming. Can wrap in a div if you want and you can read how to work with css selectors.
April 3rd 20 at 17:26
The question was how to wrap in the div? Have you tried the standard methods does not work.

<div class="style"><option class="asp_option_cat asp_option_cat_level-<?php echo $term->level; ?>"
 asp_cat_parent="<?php echo $term->parent; ?>"
 value="<?php echo $term->term_id; ?>"
 <?php echo $selected ? "selected='selected'" : ""; ?>> 
 <?php echo str_repeat("&nbsp;&nbsp;", $term->level) . $val; ?>
 </option></div>

In this embodiment, the div will not connect, tried.

Find more questions by tags PHP