Changing fontsize with textboxes and combo boxes

Is there a simple way to change to a custom font size inside the box for a textbox and a combo box. 
I know of CssClass="e-small"
I tried to use a custom class didn't seem to take.  
Thanks

7 Replies 1 reply marked as answer

SN Sevvandhi Nagulan Syncfusion Team November 3, 2020 07:55 AM UTC

Hi Chris, 



Greetings from Syncfusion support. 



You can customize the font-size as per the own need using below css code. 



<SfComboBox TValue="string" TItem="GameFields" CssClass="e-custom" PopupHeight="230px" Placeholder="Select a game" @bind-Value="@DropVal" DataSource="@Games"> 
    <ComboBoxFieldSettings Text="Text" Value="ID"></ComboBoxFieldSettings> 
</SfComboBox> 
 
<SfTextBox @bind-Value="@textBoxVal" CssClass="e-custom"></SfTextBox> 
 
<style> 
    .e-input-group.e-control-wrapper.e-custom .e-input { 
        font-size: 20px; 
    } 
</style> 


Please find the sample below, 





Please check the above sample and get back to us if you need further assistance. 


Regards, 
Sevvandhi N 


Marked as answer

AF Andrew Fong February 7, 2022 03:15 AM UTC

Hi Syncfusion team,


The above solution does not work when you use Placeholder and FloatLabelType as well. Please see code below which is just one line of additional code from the sample solution.

------------

<SfComboBox TValue="string" TItem="GameFields" CssClass="e-custom" PopupHeight="230px" Placeholder="Select a game" @bind-Value="@DropVal" DataSource="@Games">


    <ComboBoxFieldSettings Text="Text" Value="ID"></ComboBoxFieldSettings>
</SfComboBox>


<SfTextBox @bind-Value="@textBoxVal" CssClass="e-custom"></SfTextBox>
<SfTextBox @bind-Value="@textBoxVal" Placeholder="Some text box" FloatLabelType="@FloatLabelType.Auto" CssClass="e-custom"></SfTextBox>


 @code{
     ....
}


<style>
    .e-input-group.e-control-wrapper.e-custom .e-input {
        font-size: 8px;
        color: red;
    }
</style>


PM Ponmani Murugaiyan Syncfusion Team February 7, 2022 05:27 AM UTC

Hi Andrew,  

Please override the below style to meet your requirement. 

<style> 
    .e-input-group.e-control-wrapper.e-custom .e-input { 
        font-size: 8px; 
        color: red; 
    } 
    .e-custom.e-input-group, 
    .e-custom.e-input-group.e-control-wrapper, 
    .e-custom.e-float-input, 
    .e-custom.e-float-input.e-input-group, 
    .e-custom.e-float-input.e-control-wrapper, 
    .e-custom.e-float-input.e-input-group.e-control-wrapper { 
        font-size: 8px; 
        color: red; 
    } 
</style> 

Output

 

Regards, 
Ponmani M 



RP Ranjani Prabakaran Syncfusion Team February 10, 2022 12:05 PM UTC

 



VJ Vinitha Jeyakumar Syncfusion Team February 10, 2022 02:01 PM UTC

Hi Andrew, 

Query 1. " Change the font and font size of the Floating label"

You can use the below CSS styles code to customize the Floating label,

Code snippet:
.e-float-input.e-control-wrapper:not(.e-error) input:focus ~ label.e-float-text, .e-float-input.e-control-wrapper:not(.e-error) input:valid ~ label.e-float-text, .e-float-input.e-control-wrapper:not(.e-error) input ~ label.e-label-top.e-float-text, .e-float-input.e-control-wrapper:not(.e-error) input[readonly] ~ label.e-label-top.e-float-text, .e-float-input.e-control-wrapper:not(.e-error) input[disabled] ~ label.e-label-top.e-float-text, .e-float-input .e-control-wrapper:not(.e-error) input label.e-float-text.e-label-top, .e-float-input.e-control-wrapper.e-bigger:not(.e-error) input:focus ~ label.e-float-text, .e-float-input.e-control-wrapper.e-bigger:not(.e-error) input:valid ~ label.e-float-text, .e-float-input.e-control-wrapper.e-bigger:not(.e-error) input ~ label.e-label-top.e-float-text, .e-float-input.e-control-wrapper.e-bigger:not(.e-error) input[readonly] ~ label.e-label-top.e-float-text, .e-float-input.e-control-wrapper.e-bigger:not(.e-error) input[disabled] ~ label.e-label-top.e-float-text, .e-bigger .e-float-input.e-control-wrapper:not(.e-error) input:focus ~ label.e-float-text, .e-bigger .e-float-input.e-control-wrapper:not(.e-error) input:valid ~ label.e-float-text, .e-bigger .e-float-input.e-control-wrapper:not(.e-error) input ~ label.e-label-top.e-float-text, .e-bigger .e-float-input.e-control-wrapper:not(.e-error) input[readonly] ~ label.e-label-top.e-float-text, .e-bigger .e-float-input.e-control-wrapper:not(.e-error) input[disabled] ~ label.e-label-top.e-float-text, .e-float-input.e-control-wrapper:not(.e-error).e-input-focus input ~ label.e-float-text, .e-float-input.e-control-wrapper.e-bigger:not(.e-error).e-input-focus input ~ label.e-float-text, .e-bigger .e-float-input.e-control-wrapper:not(.e-error).e-input-focus input ~ label.e-float-text {
       
        font-size: 20px;
        font-family: cursive;
    }

Query 2. "Change the height of the combobox"

Please check the below CSS code to customize the ComboBox height,

Code snippet:
.e-input-group input.e-input, .e-input-group.e-control-wrapper input.e-input, .e-input-group textarea.e-input, .e-input-group.e-control-wrapper textarea.e-input {
       
        height: 50px;
    }


Regards,
Vinitha



AF Andrew Fong February 10, 2022 10:38 PM UTC

Thank you very much, support team. This is invaluable in my design.


Regards



PM Ponmani Murugaiyan Syncfusion Team February 11, 2022 05:34 AM UTC

Hi Andrew, 

Welcome, please get back us if you need further assistance. 

Regards, 
Ponmani M 


Loader.
Up arrow icon