Skip to main content
Inspiring
February 25, 2025
Question

Change Font Sizes of Snippet on different topics

  • February 25, 2025
  • 5 replies
  • 2057 views

Is there a way to make the font size different between 2 topics that use the same snippet? I've noticed that typically you need to set the font size for the snippet, but I want to use the same snippet on two different topics, but want the font size to be different.

    5 replies

    Community Expert
    March 19, 2025

    In your second PDF, is all the text supposed to be larger, and just the snippet text is not using the larger size? 

     

    If so, perhaps the problem is you have a stylesheet specifally applied to the snippet file? In that case it might use the stylesheet applied to itself, rather than the stylesheet defined for your second pdf target. Removing the stylesheet from the snippet file should fix the problem in that case.

     

     

    Legend
    February 26, 2025

    Maybe I am completely mistaken, or this has changed in update 5 (I am still on 4), but as far as I know, the snippet takes on the style of the part it is entered into. The snippet itself does not have a certain style (or at least does not need to have one). 

    So, I have a snippet with a text:

    Example text of the snippet.

    I can put it into different places of the same or, as you want to, different topics. The text always takes on the style set for the paragraph:

    Inspiring
    February 26, 2025

    So I think I got it to work, but I'm noticing that it won't work when it is a "dotted" blue outline (the top snippet), but it will work when it is a more solid blue outline (the bottom snippet).  Any idea why there is a difference here? I think I've created the snippets in the same way.

     

    Inspiring
    February 26, 2025

    The one with the solid blue line is an inline snippet. You can add snippets in two ways: as a <div> tag or as a <span> tag. The <span> tag represents the inline version and inherits the layout from the paragraph it resides in.

     

      <p class="Normal"><span data-conref="../../assets/snippets/MySnippet.hts"> </span></p>
      <div data-conref="../../assets/snippets/MySnippet.hts"> </div>

     

    Peter Grainge
    Community Expert
    Community Expert
    February 25, 2025

    If they are in different outputs, you can change the CSS in the preset. Would that work for you?

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

      

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Inspiring
    February 25, 2025

    It might. How do you change the css in the preset?

    Peter Grainge
    Community Expert
    Community Expert
    February 26, 2025

    Apply a Topic Layout with a different CSS applied to it.

     

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Peter Grainge
    Community Expert
    Community Expert
    February 25, 2025

    Thinking some more, my suggestion would not work as the P tag gets applied. I think you will need two snippets where you set the font in the Snippet Content Properties.

     

    I haven't checked but am pretty sure that will do it.

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Inspiring
    February 25, 2025

    Do you think setting up different topic layouts would help? Essentially, I am using one snippet in 2 topics, but the 2 topics are in different documents (different outputs).

    Peter Grainge
    Community Expert
    Community Expert
    February 25, 2025

    In the CSS editor duplicate your <p> tag and give it a class name such as "large".  Set the font size or colour or whatever to what you want. Appply that style to paragraphs where required.

     

    You could use a different CSS but that might not work when you generate your outputs, it depends on how you configure them.

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Inspiring
    February 25, 2025

    Thanks Peter. I tried that, but it seems like the tag thats in the snippet overrides the tag that is applied to text in a topic. The font actually appears bigger in the topic when I try that, but the output doesn't show the text as bigger.

    Inspiring
    February 25, 2025

    Actually, the font appears bigger in the topic, but when I exit out of the topic and go back in, it goes back to the original font.