I speak with literally hundreds of Flare users every month and one frustration that I hear over and over is about the strict nature of using CSS styles in an XML environment.

People are used to creating styles in an application like Microsoft Word and then being able to use those styles anywhere. Due to the strict nature of XML if you create a paragraph CSS style then it can only be used in paragraphs. If you create a list style then it can only be used in lists, and so on. This strict enforcement can be frustrating. You have a perfectly good style called p.MyStyle that makes text neon blue, italic, underlined, and with a lime green background (because that is soooo user friendly) and you want to apply this style to the second step in your procedure…but you can’t. Since this is a paragraph style you can’t use it in the list you are using to number your procedure steps.

At this point some folks would go on to create another style called li.MyStyle and go through all of the work to match the attributes of this new style to perfectly match the paragraph version. But, this is completely unecessary! What if I where to tell you that there was a way to create a single style in your Flare CSS Style Sheet that could be used on any element, anywhere in your topics, at any time?! Well, that is exactly what we are going to do.

Creating a Paragraph Class

  1. First, open Flare and open your active CSS file in the Flare style editor.
  2. Now, select the p element in the style sheet editor. We need to select it because we are going to make a new class attached to it.
  3. Once you have the p element selected, go to the toolbar and click on the “Add Class” option.
  4. Name the new class “Tip” and click OK. You will now have a new style class called p.Tip.
  5. Add some attributes to your new style class such as a background color, border lines, etc. Add the attributes so that you can definately see a change when the style class is applied to text in your topics.

OK, now we have a standard paragraph style that can be applied to any paragraph in your project. But, try to apply this new tip style to text in a table, or in a list, or in any element that isn’t a proper paragraph and poof, your nice new style disapears from the list of available styles. Now for the magic part!

Converting a Paragraph Class to a Generic Class

  1. OK, locate your CSS file in the Content Explorer view.
  2. Right click on your CSS file and select “Open with > Internal Text Editor”
  3. Now that you have access to the actual CSS code, scroll down to the bottom and find your style p.tip.
  4. Now for the magic part. Place your cursor in front of the p in the p.tip entry and….press the delete key. You want to delete the letter p and leave the .tip part.
  5. Save the edited CSS file by clicking on the save icon on the toolbar or pressing Ctrl-S.

You now have what is called a Generic Style. Open a topic in your project and place the cursor anywhere you want, in a table, in a list, in a paragraph, and no matter where you place your cursor you should now have access to your tip style.

This is a technique that can be used to make any style settings you create available at any time anywhere in your Flare project. The most important part is that this is all perfectly legal with regards to XML and CSS and won’t cause any problems with your project.


About The Author

About Mike Hamilton

Mr. Hamilton has over fifteen years of experience in training, technical communication, multimedia development, and software development. Prior to joining MadCap Software, he served as the Product Manager for Macromedia's award-winning RoboHelp product line. Mr. Hamilton is often a featured speaker at industry events, including TEKOM and STC.

Last Modified: March 22, 2011

This entry was posted in MadCap Flare, MadCap Software, Tech Comm, Tips & Tricks. Bookmark the permalink.


  • Roy Jacobsen February 20, 2008 at 8:42 AM

    I’m no CSS expert, so maybe this is a n00b question:

    Why would you do this rather than creating a SPAN style? I have some SPAN styles that I apply all over the place, not just in paragraphs or lists. Does this give you something that a SPAN doesn’t?

  • Mike February 20, 2008 at 11:47 AM

    SPAN styles are great for adding formatting WITHIN an existing element, but the technique I have outlined in this post will automaticaly create SPAN entries if necessary or create p. or td. or div. styles depending on how you try to apply the style. If using SPAN based styles is working for you then by all means, continue! :0) I was just trying to distribute a method that a lot of folks could possibly benefit from.

  • Kevin Amery February 25, 2008 at 7:22 AM

    To put it another way: a span class can only be used for spans. A generic class can be used for *anything*.

  • Paul February 25, 2008 at 8:58 AM


    The great thing about generic classes in CSS is that they can be used in both block-level elements and inline elements. So you can use in in the a element, or you can use it in a element.

    If I can, I prefer to apply my classes to the block-level item, as it seems cleaner, and is easy to remove in a find/replace down the road. The code is easier to read because you don’t have scattered s all over the place, and it is more semantic (you know that you are looking at a paragraph that is a type “tip”).

    I LOVE generic classes. Thanks for the tip.

  • Steven Ksiezak March 17, 2016 at 7:40 AM

    I am a newbie to Flare and I am sure that I am telling my grandmother to suck eggs but I have found a restriction. I was playing about with a stylesheet and I wanted to copy only some styles from one stylesheet to another. I found I could do this with ordinary classes but the generic ones do not give you the opportunity to copy them to another sheet. Can you comment on this please

Have Something to Say?

Your email address will not be published. Required fields are marked *