Copied to clipboard

Flag this post as spam?

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


  • Barry Fogarty 493 posts 1129 karma points
    Jan 21, 2015 @ 14:12
    Barry Fogarty
    0

    Unable to set tag styles in RTE

    Am I going mad or is it impossible to set HTML tag styles (e.g. H2)  in the RTE?  I have ensured I followed the correct steps outlined here and the process works fine for class-based selectors but not for regular HTML tags.

    I have posted my RTE.css I created to test this below.  The styles all appear in the dropdown OK, and selecting the 'Massive' class results in the following markup: 

    <pre><p><span class="massive">Sub heading</span></p></pre>

    (Annoying use of span but anyway, it works).  

    HOWEVER, trying to select a Heading style does not change the markup at all, the selected text still remains as a P.

    I have tested this on v7.2.0 and also I installed a fersh copy from WebMatrix (v7.1.6) puely to test this issue.  The result in both cases is as I describe above.  If you can corroborate my findings please let me know and I will raise a bug.  Or let me know the crucial step I am missing!  Thanks.

    RTE.css:

    h1,h2,h3,h4,h5,h6 {    font-family: serif;   color: #ea357f; font-weight:normal; line-height: 1.2; margin:0 0 10px 0; }
    h1,h2,h3 { letter-spacing: -1px; }
    h1 { font-size:24px; }
    h2 { font-size:22px; }
    h3 { font-size:20px; }
    h4 { font-size:18px; }
    h5 { font-size:16px; }
    h6 { font-size:14px; }

    /* EDITOR PROPERTIES - PLEASE DON'T DELETE THIS LINE TO AVOID DUPLICATE PROPERTIES */
    H2 {
    font-size:62px;
    }
    H3 {
    font-size:42px;
    }
    H4 {
    font-size:32px;
    }
    H5 {
    font-size:22px;
    }
    .massive {
    font-size:62px;
    }
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 21, 2015 @ 14:16
    Jan Skovgaard
    100

    Hi Barry

    Have you added the tags as child of the RTE style so they're listed underneath rte in the umbraco backoffice?

    Like this

    rte - h1 - h2 - .massive

    etc?

    If so...have you made sure that the alias corresponds to the desired element name? So that the value in alias is h1 for heading 1?

    Hope this makes sense.

    /Jan

  • Barry Fogarty 493 posts 1129 karma points
    Jan 21, 2015 @ 14:25
    Barry Fogarty
    0

    Hi Jan, yes and yes.

    AHA - THanks Jan, the values are case sensitive, I had set the aliases as H2 etc.  Correcting that to lowercase resolved the issue.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 21, 2015 @ 14:26
    Jan Skovgaard
    0

    Hi Barry

    Happy to hear you got it sorted - yup it is indeed :)

    Happy coding.

    /Jan

  • Barry Fogarty 493 posts 1129 karma points
    Jan 21, 2015 @ 14:34
    Barry Fogarty
    1

    NB One gotcha to note is that editing the styles in the backoffice results in all CSS code above the 

    /* EDITOR PROPERTIES - PLEASE DON'T DELETE THIS LINE TO AVOID DUPLICATE PROPERTIES */

    line gets removed.

Please Sign in or register to post replies

Write your reply to:

Draft