Label on top of RadMaskedTextBox

1 Answer 38 Views
Input Label MaskedTextBox
Gary
Top achievements
Rank 1
Gary asked on 02 Nov 2023, 03:25 PM | edited on 02 Nov 2023, 03:26 PM

I have added a RadMaskedTextBox to a form. My layout uses bootstrap. All of my other controls have the label at the top, but when I add the RadMaskedTextBox , the label goes to the left. This happens whether I use the asp label or the built in label for the control.

 <telerik:RadMaskedTextBox ID="rmtPhone" runat="server" RenderMode="Auto" Mask="+1 (###) ###-####"  Label="Phone"></telerik:RadMaskedTextBox>

 

Does anyone have a solution to move the label to the top?

1 Answer, 1 is accepted

Sort by
1
Accepted
Vasko
Telerik team
answered on 03 Nov 2023, 03:55 PM

Hello Gary,

By default, the RadMaskedTextBox has the following CSS class applied to its label: 

<style>
    .RadInput .riLabel {
        float: left;
        padding: 5px 10px 5px 0;
        text-overflow: ellipsis;
        overflow: hidden;
    }
</style>

The float: left makes the label's position on the left side of the masked text box. To set it to the top of the text box, set the float property to none: 

<style>
    .RadInput .riLabel {
        float: none;
    }
</style>

I hope this helps you out.

Kind regards,
Vasko
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
Tags
Input Label MaskedTextBox
Asked by
Gary
Top achievements
Rank 1
Answers by
Vasko
Telerik team
Share this question
or