How to add CSS class to options layout in Ui.select

{ view:"select", label:"Version", options:["1.0", "1.5", "2.0"]}

Comments

  • Hello @kishorech,

    While it is possible to add a class to each option dynamically (the select component is based around the native HTML select, which means that the dropdown menu is basically an array of <option> tags), I wouldn't recommend doing so, since you would have to apply a class for each individual option, and in some cases that might be an unacceptable scenario.

    As a better alternative, you could add a CSS class to the select component itself, which then in turn allows you to style the options of that specific select. For example: https://snippet.webix.com/bh3g1rwk.

  • .c_options option {
    color: red;
    border-radius: 100px;
    background-color:black;

    }

    I want to apply border-radius but it is not working

  • edited November 7

    option is OS-dependent. You can't style them like other elements.

    More detailed answer: https://stackoverflow.com/a/7208814

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!