Set color of checkbox text

2 posts, 0 answers
  1. Jack
    Jack avatar
    5 posts
    Member since:
    May 2007

    Posted 29 Aug Link to this post

    Recently I submitted a support ticket to find out how I could change the color of the text of a RadCheckBox. I'm not as fluent in css as I should be so I thought I would share my findings for others like me with limited css skills.

    To change the color of the text of all checkboxes on the page create the following css rule

    <style>
        .rbText  {
           color: red !important;
        }
    </style>

    If you need to change the color of only some checkboxes (in my case I have a couple that are required and I wanted to make the red leaving all others black) you can create a rule that looks like this

    <style>
        .required .rbText  {
           color: red !important;
        }
    </style>

    and then assign the required css class to the checkbox like this

    <telerik:RadCheckBox ID="blnCorrectiveAction" runat="server" Text="Corrective Action Necessary" CssClass="required"></telerik:RadCheckBox>

    I'm sure the css pros think this is silly simple thing so say but for those of us that struggle I hope this helps 

  2. Magdalena
    Admin
    Magdalena avatar
    421 posts

    Posted 30 Aug Link to this post

    Hi Jack,

    Thank you for sharing your knowledge with the community.

    This solution will work for all RadButton-s as well. If you would like to specify only check-boxes, you can use the following CSS:
    html .RadButton.rbCheckBox .rbText {
        color: red;
    }

    Adding the "html" you will make the selector stronger as the inbuilt styles, so you do not have to use !important.

    Regards,
    Magdalena
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top