Inline style not overriding class

2 posts, 0 answers
  1. Matt
    Matt avatar
    3 posts
    Member since:
    Aug 2012

    Posted 10 May 2011 Link to this post

     

    Hi, I have a display issue I hope someone can help me with.

    When I apply a class to a block of text in the editor, it creates a span tag surrounding the text and assigns
    its class attribute properly.  The problem is when I highlight that same block of text and apply
    a specific font, the font from the CSS class is displayed in the editor, not the inline style font
    value.

    The HTML resulting from this is :

    <P> <SPAN style="FONT-FAMILY: Times; FONT-SIZE: 24pt" 
    class=Headline>This is a test</SPAN></P>

    The HTML is what I expect, but the editor displays the font as Verdana (which is specified in the Headline class), not Times. If I paste this HTML into a browser, the font displays as times. Does the editor handle style inheritance differently than the browser?
  2. Rumen
    Admin
    Rumen avatar
    13804 posts

    Posted 12 May 2011 Link to this post

    Hello Matt,

    All you need to do is to disable the ConvertFontToSpan filter of RadEditor which converts the span tags to font tags when the content is displayed in Design mode. This is needed because the browser's commands such as FontName and FontSize work with <font> tags.

    You can find more information about the content filters in this article: Content Filters.

    Best regards,
    Rumen
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top