This content has been marked as final. Show 7 replies
Welcome to the forum.
Snippets do not link to a stylesheet. The idea is that they take on the stylesheet of whatever topic they appear in.
If you always want them to appear with a particular style regardless of what topic they are in, for example if you are creating a warning and always want it have a red background, you need to apply inline styles. Embedded stylesheets don't work either. Inline styling only.
Thanks, yes, I finally figured this out. It would have saved me about 2 hours of time and a lot of fumbling if the online help had just mentioned that you need to save the snippet before you can drag it into your topic and have it 1) appear, and 2) use the style sheet that the topic uses.
Maybe this is obvious, but it sure wasn't to me! Anyway, thanks for your help. I'm learning a lot from this forum.
I understand this discussion so far.
However, when editing Snippets, it is possible to change the Style of the Snippet text. There are some basic/default/standard styles available. However, since the Snippets are not associated with any (custom) style sheet, non-basic/default/standard styles are not available.
For example, my Snippets have a "Header 1", "Normal", "Header 2", "Normal" style, etc. for headings versus normal text. However, I have special formatting too, which I cannot apply in the Snippet (but which does appear in the topic that uses the Snippet).
Is there some way to apply the topic's Styles to the Snippet?
Found the solution to my problem: While Snippets only allow for standard styles by default, it is possible to simply enter a new style name in the style box. Since the Snippet does not recognize this style, it will show up with the "Normal" formatting. However, if this Snippet is placed in a topic that does recognize this style, then the formatting appears properly.
For example, I use a style called "Title-2" which is similar to "Heading 2". In my Snippet, I enter "Title-2" as the style for my title heading. This title heading is not formatted properly in my Snippet. However, when I load this Snippet in a topic that does have the style "Title-2" defined, the formatting show up properly.
Do you have to generate a printed output as well? If you do, check what happens there before you go too far. I have an uncomfortable feeling you would get one format throughout. Haven't tested.
Ai. Good idea. Will do.
Let us know the result please.