Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Claushingebjerg 936 posts 2571 karma points
    Sep 12, 2014 @ 10:22
    Claushingebjerg
    0

    css classes in RTE rsults in <span> tags...

    I dont know if its a bug or by design.
    If it is by design, could someone please explain the logic behind the following:

    if you define classes in your RTE stylesheet, lets say like this where i have a standard paragraph and a class:

    p { font-size:14px;}
    .callout {background:#999;}


    Why are thes classes wrapped in span tags when used in the RTE?


    Writing the paragraph works as expected:

    But when selecting the text and choosing the class does not:

    One would expect the class to be applied to the <p> tag.

    <p class="callout">This is a parapraph</p>

    'm pretty sure this was the behavior before v7..

  • Valerie 67 posts 163 karma points
    Jan 19, 2015 @ 11:48
    Valerie
    0

    Yeah it worked perfectly before :(

    I saw this https://gist.github.com/bjawnie/a1fac50d99d7aff40cc8 where someone has altered it to add classes, but only to p tags...

  • Søren Lysdal 13 posts 75 karma points
    Jan 29, 2015 @ 07:45
    Søren Lysdal
    1

    I got fed up with this as well, after correcting it in several by implementing custom RTE controllers on top i decided to just rewrite the Umbraco one and make a pullrequest for it: https://github.com/umbraco/Umbraco-CMS/pull/630

    Supports *.* and *#*, respectively setting block and class/id, so the following works:

    p.class
    h1#title
    p.class.anotherclass 

     

Please Sign in or register to post replies

Write your reply to:

Draft