Global fonts and RadControls

Thread is closed for posting
4 posts, 1 answers
  1. Paolo Broccardo
    Paolo Broccardo avatar
    7 posts
    Member since:
    Oct 2009

    Posted 13 Oct 2009 Link to this post

    Hi

    I have set up a font-family on a body level in my CSS.

    I would like this font to filter through to my RadControls so that if I change it in one place, the changes are constant throughout the whole system.

    Currently the RadControls display their own font which differs from my global font.
    How do I change this? Obviously I mean WITHOUT having to specify any font attributes on the RadGrid controls.

    Thanks
    Paolo
  2. Answer
    Dimo
    Admin
    Dimo avatar
    8331 posts

    Posted 15 Oct 2009 Link to this post

    Hello Paolo,

    RadControls skins do not inherit font styles from the page on purpose, as this could lead to rather unexpected results (especially when it comes to font size).

    In your case, you can override all RadControls skins with a single CSS rule like this:


    body,
    body  *
    {
           font-family: .... !important;
    }


    Greetings,
    Dimo
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nitish
    Nitish avatar
    11 posts
    Member since:
    Mar 2011

    Posted 13 Dec 2011 Link to this post

    when we use
    * {
    font-family : Verdana !important;
    }
      
    OR
      
    body *
    {
    font-family : Verdana !important;
      
    }
    Above code is working well. But when we use radeditor and change the font of text from design mode. It will not changes.
    It remains verdana there
    Please help me asap.
  5. Rumen
    Admin
    Rumen avatar
    12849 posts

    Posted 14 Dec 2011 Link to this post

    Hi Nitish,

    This is an expected behavior because the * global class has priority over the inline font-family style as well as over the face inline attribute.

    The solution is to set the CssFiles property of RadEditor and the editor will not inherit the styles from the page, e.g.

    <telerik:RadEditor ID="RadEditor1" runat="server">
        <CssFiles>
            <telerik:EditorCssFile Value="~/empty.css" />
        </CssFiles>
    </telerik:RadEditor>


    Best wishes,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top