Alternative background for list items

2 posts, 1 answers
  1. Jianwei
    Jianwei avatar
    20 posts
    Member since:
    Feb 2011

    Posted 08 Jun 2015 Link to this post

    I have a dropdown list and would like to style alternative items with different background colors, is there a way to do it in "CSS", I would try not to use Javascript do it. 



  2. Answer
    Plamen Lazarov
    Plamen Lazarov avatar
    135 posts

    Posted 08 Jun 2015 Link to this post

    Hello Jianwei,

    ComboBox and DropDownList list items are wrapped in a div with an id which is created from the id of the html element from which the widget is initialized and the string "-list". In other words if we use <input id="countries" /> to initialize a ComboBox or a DropDownList the div containing the <ul> with the list items will have countries-list as an Id.  

    In order to achieve the desired result a CSS style could be applied to list items. Please refer to the example below:


    Plamen Lazarov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top