Set font-size for items in a DropDownList

1 Answer 12 Views
DropDownList
Anders
Top achievements
Rank 1
Veteran
Iron
Anders asked on 17 Apr 2024, 08:01 AM

Hi,

How do I set the font size for items in a DropDownList?

I saw a tip suggesting the method below, but it hasn't worked for me.

k-popup .k-item {
  font-size: 24px;
}

Please advise.

/Br Anders

1 Answer, 1 is accepted

Sort by
1
Ivan Danchev
Telerik team
answered on 19 Apr 2024, 08:29 AM

Hi Anders,

You can use the following CSS rule to increase the size of the font in the DropDownList items:

<style>
    .k-popup li {
        font-size: 24px;
    }
</style>
Be advised that this will affect all li elements nested in an element with the class "k-popup". So, if you want to target a specific DropDownList, you could use the id of the popup ul element. See this example: https://netcorerepl.telerik.com/wIYoFtkM22rgp9e837

The CSS rule is the following:

<style>
    #color_listbox li {
        font-size: 24px;
    }
</style>

The id of the popup ul element that contains the li elements is formed like this: the Name of the component (in the example linked above the name is color) concatenated with "_listbox". This is why the selector used in my example is:

#color_listbox li


Regards,
Ivan Danchev
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.

Anders
Top achievements
Rank 1
Veteran
Iron
commented on 19 Apr 2024, 01:47 PM

Thanks for quick response! /Br. Anders
Tags
DropDownList
Asked by
Anders
Top achievements
Rank 1
Veteran
Iron
Answers by
Ivan Danchev
Telerik team
Share this question
or