DropDown List Change Font Size

Hello,

I would like to change the font size of the placeholder and the drop down list items. But couldn't find in documentation where t



3 Replies 1 reply marked as answer

SP Sureshkumar P Syncfusion Team September 15, 2022 11:34 AM UTC

Hi Shannon,

You can achieve your requirement by using the below CSS styles.

Find the code example here:

<SfDropDownList TValue="string" Placeholder="e.g. Australia" FloatLabelType="Syncfusion.Blazor.Inputs.FloatLabelType.Never" TItem="Country" @bind-Value="@DropVal" DataSource="@Countries">

    <DropDownListFieldSettings Value="Name"></DropDownListFieldSettings>

</SfDropDownList>

 

@code {

 

    public string DropVal;

 

    public class Country

    {

        public string Name { get; set; }

 

        public string Code { get; set; }

    }

 

    List<Country> Countries = new List<Country>

    {

        new Country() { Name = "Australia", Code = "AU" },

        new Country() { Name = "Bermuda", Code = "BM" },

        new Country() { Name = "Canada", Code = "CA" },

        new Country() { Name = "Cameroon", Code = "CM" },

    };

}

 

<style>

    .e-ddl.e-input-group input.e-input::placeholder {

        font-size:10px;

    }

 

    .e-dropdownbase .e-list-item {

        font-size: 10px;

    }

 

</style>

Find the sample in the attachment:

Regards,

Sureshkumar P


Attachment: DDLServer_a165f4d4.zip

Marked as answer

SH Shannon September 15, 2022 08:58 PM UTC

thank you!



SP Sureshkumar P Syncfusion Team September 16, 2022 04:21 AM UTC

Hi Shannon,

Thanks for your update.


Regards,

Sureshkumar P


Loader.
Up arrow icon