2010-04-27 13 views

risposta

10

qui è quello che volete Styling Dropdown Lists

<style type="text/css"> 
 
    option.red {background-color: #cc0000; font-weight: bold; font-size: 12px;} 
 
    option.pink {background-color: #ffcccc;} 
 
    </style> 
 

 
    <select name=colors> 
 
    <option class="red" value= "../getting_started/">Getting Started </option> 
 
    <option class="pink" value= "../getting_started/html_intro1.htm">- Intro to HTML 
 
    </option> 
 
    </select>

+0

Che cosa succede se sto riempiendo l'elenco a discesa da una lista in questo modo: '@Html. DropDownListFor (m => m.ModActionCatList, actionCatList, new {@class = "select2-select-00 col-md-12 full-width-fix richiesto" ... " –

+0

Forse qualcuno può aiutare a chiarire un po 'di confusione, ho guardato up '