To update the design of select option form elements with CSS, you can create a custom dropdown using JavaScript. Here is an example:
<div class="dropdown-wrap" id="dropdown-wrap">
<div class="dropdown-head pointerCursor" id="dropdown-head">
<span class="sel-option" id="sel-option">Display header</span>
</div>
<ul class="list-ul pointerCursor hide" id="list-ul">
<li class="list-li" data-val="1">1</li>
<li class="list-li" data-val="2">2</li>
<li class="list-li" data-val="3">3</li>
</ul>
</div>
You should add event listeners to show and hide the dropdown list:
document.getElementById('dropdown-head').addEventListener('click', (e) => this.showTeamsList(e));
document.getElementById('dropdown-wrap').addEventListener('mouseleave', (e) => this.hideTeamsList(e));
The event listener functions will manipulate the visibility of the list by adding or removing the 'hide' class, which sets the max-height property to 0.
.hide {
max-height: 0 !important;
}
In the CSS for list-ul, make sure to include overflow: hidden to fully hide the list when needed.