Styles are elements that contain formatting settings. You can apply styles to your content to change the way it looks. Flare works with cascading style sheet (CSS) rules that are specified by the World Wide Web Consortium, or W3C (http://www.w3.org).
example
The heading above is using the <
An important aspect of CSS is that it is based on community-wide standards set by the W3C. This means that CSS can be used for any XML-based tool, not just Flare. Tools such as Microsoft Word and Adobe FrameMaker also use styles, but they are proprietary, which means they can be used only within that application.
The vast majority of the styles and style properties in Flare were developed by the World Wide Web Consortium (W3C). For more thorough information about each W3C style and property, refer to http://www.w3.org and use the search feature on the website.
Also, when you select a property in the Stylesheet Editor in the Flare interface, a short description of the property is displayed at the bottom of the editor.
The following additional resources are highly recommended for learning more about CSS:
Online School
Cascading Style Sheets: Designing for the Web
by Hakon Wium Lie and Bert Bos
HTML, XHTML, and CSS, Sixth Edition (Visual Quickstart Guide)
by Elizabeth Castro
CSS: The Definitive Guide
by Eric Meyer
In addition to the many standard styles from W3C, you might notice several unique-looking styles that begin with the word "MadCap" (e.g., MadCap|footnote, MadCap|variable). There are also many MadCap-specific properties. You will recognize these properties because they always start with "mc" (e.g., mc-footnote-format, mc-language).
These special styles and properties have been added to the Flare user interface in order to support some of the unique features available only in MadCap Software products.
CSS is a lot more than simply a method for changing the look of text in your documentation. It can certainly be used to modify text in all kinds of ways (e.g., size, font type, color), but it can do a whole lot more, including changing the presentation and behavior of the following elements:
One of the best ways to truly appreciate the power of CSS is to visit http://www.csszengarden.com. This website contains text and links that let you apply different CSS files to the content. Each time you select a different CSS file, the look and feel of the page changes dramatically.
In order to truly understand CSS, you need to understand how different parts of an XML-based document relate to corresponding style elements.
As the following image shows, HTML and XHTML documents have certain style elements, usually with opening and closing tags (e.g., <HTML> and </HTML>).
Following are the three main ways to use CSS rules.
Inline CSS
With this method, you specify the formatting rule for the content at the spot where it exists in the document. Although this type of implementation is allowed, it is not recommended because changing the look of the text in the future might mean making changes in many files and many places instead of just one.
Embedded CSS
With this method, you specify formatting rules for elements within a file and they affect only that document.
example
You might decide to specify that every paragraph in the document should be 11 points. Therefore, in the XHTML document code, you specify between the <head> tags that all paragraphs (<p> tags) should be that size. As a result, every time a <p> tag is found in that document, the text will be 11 points. In the behind-the-scenes XHTML code, it might look like this:
This method is a bit more powerful than the inline method, but it still does not allow you to control the look and feel of more than one document at a time, therefore it also is not recommended.
If you want to use embedded CSS in Flare, you would need to open the XHTML code (in the Internal Text Editor or in a third-party editor) and enter the embedded CSS rules manually.
External CSS
With this method, you DO NOT specify formatting rules anywhere within the XHTML or HTML document. Instead, you specify the rules in a separate, external file that has a .css extension (see Creating New Style Sheets and Editing Styles). Then, in the XHTML document you provide a link to that external style sheet (see Applying Master Style Sheets and Applying Style Sheets to Topics).
example
You might decide to specify that every paragraph in all of your documents should be 11 points. Therefore, you create an external style sheet, name it something like styles.css, and specify within it that all paragraphs (<p> tags) should be that size. This work can be done in the Flare interface. If you look at the behind-the-scenes code in the CSS file, it might look like this:
Then you associate the external style sheet with all of the XHTML files that you want to use that look and feel. Again, this can be done in the Flare project at multiple levels (topic, target, and project). If you look in the behind-the-scenes XHTML code of one of the document files, it might look like this:
External style sheets are recommended over the other methods. They make it possible to truly separate the content from the presentation and allow you to apply formatting to multiple places at once.
Best Practice: Use external style sheets instead of local formatting.
Because there are multiple ways to implement CSS (inline, embedded, external), what happens if there is a conflict? For example, what if you use the inline method to set paragraphs to green, but then you use the external CSS method to set paragraphs to blue? "Cascading" is the concept that is used to decide which method "wins" when such a conflict occurs. It's all about order of precedence. Inline has precedence over embedded styles, and embedded styles have precedence over external style sheets.
So if you make changes in an external style sheet and notice that the look is not being changed, you might check to see if an inline or embedded style setting is overriding it.
Flare lets you
Topic style sheets This type of style sheet lets you store styles for general content in your project. You can have as many styles as you want within one topic style sheet
Note: If you would like to access the same style sheet that is used for the Flare documentation, you can download it from this location:
http://www.madcapsoftware.com/documentation/Styles/styles.css
After downloading this file, it opens in Notepad. You can then select File>Save As in Notepad and save the style sheet to any location you want. For example, if you already have a project where you want to use it, you can navigate to the folder where that project is stored in Windows and save the style sheet in the Content\Resources\Stylesheets subfolder.
Note: You cannot use multiple style sheets per topic for native Adobe PDF, Microsoft XPS, and XHTML outputs.
Table style sheets This type of style sheet lets you create a unique look for tables that you insert
example
You might use two different types of tables in your project—a "basic" one (with simple borders and no shading) and a "fancy" one (with customized borders and colored shading in certain rows and columns). So you create one table style sheet (let's say it's called "basic.css") and format it the way you want, and then you create a second table style sheet (let's say it's called "fancy.css") and format it. Then, as you insert tables into your topics, you can associate the new table with one of these two table style sheets.
Note: Even though you can create a table style sheet to affect the look of your tables, you can also use a topic style sheet to modify standard CSS table tags (e.g., <th>, <td>) that are used to dictate the look of different parts of a table (e.g., heading text, table cell text). If you like, you can use both kinds of style sheets to change the look of tables.
Note: If you are importing Adobe FrameMaker documents and have tables that you have formatted in a certain way, you can create matching table styles as a result of the import. This can be specified on the Options page of the Import FrameMaker Wizard. In the Flare project, the new table styles will be named after the format named applied to the table in FrameMaker (e.g., "Format_A.css," "Format_B.css," and so on). You can rename these table style sheets in Flare after the import. Even if you do not use this mapping feature, the table formatting still comes across when you import the files. The only difference is that table style sheets make it easier to maintain the formatting of your tables within Flare.
When you want to use styles in your content, the style sheet needs to be made available for the content in question. In Flare, you can associate style sheets with a single topic
See Applying Master Style Sheets.
Best Practice: Use master style sheets at the project or target level.
Note: If you apply a master style sheet at either the target or project level, you will no longer be able to associate style sheets at the topic level (unless you remove the master style sheet associations at the project and/or target level). If you have previously applied multiple style sheets to a single topic and then switch to using a master style sheet, you should make sure that all of the styles you need from the various style sheets are all included in your master style sheet.
When you open a topic style sheet, it is displayed in the Stylesheet Editor. When you open a table style sheet, it is displayed in the Table Style Editor.
The Stylesheet Editor allows you to use either an "Advanced" view or a "Simplified" view when working with topic styles.
The Table Style Editor contains multiple tabs and fields for specifying settings such as patterns, borders, backgrounds, alignment, and margins.
Although Flare provides you with a user interface to work on styles, you can get behind the scenes to see and edit the code for the style sheet. One way to do this is to open the style sheet in Flare. Then click the Send To button
in the Standard toolbar and select Notepad. If you make changes in that file, those edits are displayed in the Flare Stylesheet Editor when you save the file in Notepad.
When working with styles, there are some unique terms that you will encounter, especially in topic style sheets.
In the Stylesheet Editor, you will notice several elements in the Styles section that already exist for your use. These are called "tags." You also might hear them referred to simply as "styles" or as "selectors." A tag is an element to which you assign a look and feel. You can then apply that style to your content, so that the content takes on the look and feel associated with the style. Different kinds of tags are available in a style sheet, to be used for various purposes in your content.
example
<p> is a tag, which can be used to affect the look of paragraphs in your content. Another tag is <h2>, which can be used to affect the look of second-level headings in your content. Yet another tag is <span>, which can be used to affect the look of character-level content (e.g., a portion of a paragraph, but not the entire paragraph).
You can think of tags as parent styles, because they can have children. A child of a tag is called a "class." Some of these classes might already be included in your style sheet
Note: Although you can create new style classes, you cannot create new parent tags.
When you create a class, it automatically takes on all of the same qualities (or "attributes") from the parent tag (e.g., color, alignment, size). However, you can change some of those attributes for the class as necessary so that it is different from the parent tag in some ways.
example
Let's say you want to create a special look for paragraph notes in order to provide additional information in a topic. In addition, you might want yet another special kind of paragraph to be used for tips. Perhaps you want a blue background for your note paragraphs, and you want a yellow background for your tip paragraphs. Meanwhile, for your regular paragraphs, you do not want any colored background.
Therefore, you could create a class of your parent <p> tag and name it "Note." Then you might create another class of your <p> tag and name it "Tip." For the Note class, you could change the background property to display in blue, and you could change the same property for the Tip class to display in yellow. But you would leave the background property for the parent <p> tag as it is, without a color. In the end, both the Note and Tip classes would take on all of the style settings from its parent tag—<p>—with the exception of the background color that you have specified for each.
How can you distinguish between parent tags and style classes? In the Simplified view of the Stylesheet Editor, style classes are listed after the parent tags, and a period is added between the name of the parent tag and the name of the class (e.g., p.Tip).
In the Advanced view of the Stylesheet editor, parent tags and style classes are shown in a tree view. You can click the plus button
next to a parent tag to see its style classes.
Every tag and style class has certain attributes that contribute to its look and feel. The elements used to control these attributes are known as "properties," which can be organized into property groups (in the Advanced view of the Stylesheet Editor). The precise information within a property is known as a "value."
example
Returning to the example of a note for a paragraph tag (p.Note), let's say we want the background to be blue. That particular quality can be controlled in a property called "background-color." In the Advanced view of the Stylesheet Editor, this property can be found in the property group named "Background." For our p.Note style, we would assign a value of "blue" to that property.
There are hundreds of basic properties that you can use to change various aspects of a style.
example
Let's say that you plan to create several bulleted lists in your topics, and you want to be able to change the look of bullet items using a style. Perhaps you want to do this for bullet items that are indented to the second level in a list (i.e., they are sub-bullets of first-level items in the list). Suppose you want those bullet items to be displayed in a blue, 10-point Verdana font. Like this:
In order to do this, you might first select the <li> tag in the Stylesheet Editor and create a class for it named "Indented2" (li.Indented2). Then you could select this class, open the Font property group, and change the "color," "font-family," and "font-size" properties.
Therefore, in a situation such as this, you would have set the following in the Stylesheet Editor:
Style class: li.Indented2
Property: color (value=blue)
Property: font-family (value=Verdana)
Property: font-size (value=10 pt)
Here is how it would look when you are finished (in the Simplified view of the style sheet).
Here is how it would look when you are finished (in the Advanced view of the style sheet).
One of the features of CSS that makes it much more powerful than other style systems is inheritance. This is simply the idea that elements in your document can inherit the style settings from other elements. This occurs when one style element is added within another element, therefore creating a parent-child relationship. The child inherits all of the style settings that the parent has, unless you override those settings on the child element. This can be a very powerful feature because it allows you to set properties on a parent element once rather than setting the same thing on all of its children elements.
example
Let's say you want all of your block-level elements to use Arial as the font type. Rather than setting Arial on all of the various tags (h1, p, div, ul, li), you can set it on the <body> tag. That way, the setting will "trickle down" automatically to all of the child elements.
After some time you might decide that you want to continue using Arial for all of those elements except the <p> tags. In that case, you can simply set the other font type on the <p> style. The rest of the elements will continue to use Arial.
What happens if a value is not set on the <body> tag in the style sheet? In that case, the value is inherited from the element's setting in the end user's browser.
There are several categories of styles that you can apply to content. To filter the list of styles shown, use the drop-down list in the Show Styles section of the Stylesheet Editor.
For steps on applying each type of style to content in your project, see Applying Styles to Topic Content. Following are explanations of the basic types of styles.
Auto-numbered styles These are styles to which an auto-number format has been applied. Therefore, an auto-number format style is not technically a unique type of style, because an auto-number format can actually be applied to other types of styles (such as paragraphs and headings). If you apply an auto-number format to a style, that style will be listed in the Stylesheet Editor if you select Show Auto-numbered Styles.
example
You might select the <h1> style tag and modify its "mc-auto-number-format" property, choosing a format such as {n+}. If you then select Show Auto-numbered Styles in the Stylesheet Editor, the <h1> style will be listed.
See About Auto-Numbers.
You can also use this kind of style to apply different master pages to different topics.
example
You might want most topics in your project to use the same master page (to display the same text at the bottom of each topic). However, maybe you want a select few other topics to use a different master page. For the majority of the topics, you can simply apply the main master page to the target. But for the other topics, you can use a topic style. For example, you can create a class for the <html> tag in your style sheet, naming it "SpecialMasterPage" (i.e., html.SpecialMasterPage). Then you can modify the "mc-master-page" property for that class so that it is associated with the secondary master page. Finally, you can apply the html.SpecialMasterPage style to the topics that you want to be associated with that master page.
How to use multiple master pages by creating topic styles
to save your work.
to turn on the structure bars. In the context menu, select Style Class and choose the style that you want to apply.
Note: You will not see any styles from this list until you create a class for the <html> tag in the Stylesheet Editor.
example
You might select a style class called "p.Body" that you have created and modify its "font-size" property to enlarge the body text in your topics.
example
You might select the <MadCap|footnote> style and modify its "mc-footnote-number" in order to restart the numbering for footnotes at each chapter (as opposed to each book, page, or section). You might select the <MadCap|footnoteBlock> style and modify its "color" property in order to show the footnote text in blue.
See About Footnotes.
Heading styles These are styles that are applied to content intended to serve as headings above sections of content.
example
You might select the <h2> style and modify its "font-family" property in order to display second-level headings in an Arial font.
Character styles These are styles that are applied to selected text within a paragraph, rather than the entire paragraph.
example
You might select the <span> style and create a class under it named "code" (span.code). Then you might set its "font-family" property to "Courier New" in order to display text that represents programming code.
example
You might select the <th> style and modify its "color" property in order to display table header row text in green.
Note: These styles are not to be confused with the separate table style sheets that you can create. However, you can use both table style sheets and these standard table styles from a topic style sheet in order to design the look of your tables and their content.
example
You might select the <li> style and create a class under it named "indented." Then you might set its "margin-left" property to "0.5 in" so that bulleted list items are indented one-half inch from the left edge.
Link styles These are styles that are applied to content that contains a link, such as a cross-reference
example
You might select the <MadCap|xref> style and modify its "mc-format" property to change the text displayed in cross-references (e.g., "see page…").
Image styles These are styles that are applied to images and objects that you inserted into topics.
example
You might create a class under the <img> tag, name it "Thumbnail" (img.Thumbnail), and modify its "mc-thumbnail" property. This lets you specify that pictures using that tag should be shown as small thumbnails until the end user either clicks or hovers over the thumbnail to see the large version.
Dynamic effects styles These are styles that are applied to content used in Dynamic HTML effects, such as drop-down text or popups.
example
You might select the <MadCap|dropDown> style and modify its "mc-open-image" and "mc-closed-image" properties in order to change or remove the image, such as an arrow, displayed next to drop-down effects.
Reusable content styles These are styles that are applied to reusable content, such as snippets, variables, or proxies.
example
Generated content styles These are styles that are applied to content that is created when you generate output, such as glossaries, indexes, or tables of contents (TOCs).
example
You might select the "TOC1" class under the <p> tag (p.TOC1) and modify its "mc-leader-format" property. This lets you set the leader format, such as dots, to be displayed after the first-level headings in the generated TOC
Controls/form styles These are styles that are applied to content within controls, such as buttons, or forms.
example
You might select the <form> style tag and modify its "text-align" property in order to center a form that you add in a topic.
Pseudo classes are a special group of style classes in cascading style sheets that pertain to elements when they're in a certain state. They are most often used for styles associated with hyperlinks.
Link pseudo classes include the following:
example
Let's say you want the text to display in green for links that have not yet been clicked. But after a link is clicked, you want it to display as gray text. Therefore, under the <a> style tag, you modify the "link" pseudo class and change the font color to green. Then you modify the "visited" pseudo class under the <a> tag so that the font color is gray.
There are a couple of additional kinds of pseudo classes that you can create from the Stylesheet Editor. These are called "first-letter" and "first-child" pseudo classes.
The first-letter class lets you apply style settings to the first letter in a block (such as a paragraph), if it is not preceded by any other content (such as an image). This pseudo class is useful for creating drop caps and initial caps effects. See Creating Initial Caps Effects
The first-child class lets you apply style settings to the first child of another element (e.g., the first <p> tag that occurs within a <div> tag).
What if you want to use certain style settings for some
A medium is an alternative set of styles in a style sheet that you use for different outputs. They are intended to be an exception to the default style you want to use.
example
Let's say you have text hyperlinks that are shown in blue font with an underline. That may be fine for Target A, but let's say you want this style to appear in black font with no underline for Target B. The solution is to use a style sheet medium.
Suppose Target A is using the "default" medium, where the blue underline properties are specified. With the properties for Target A already set, you now need to specify style properties for Target B. Therefore, in the Stylesheet Editor, instead of selecting the "default" medium, you can select another medium (e.g., the "print" medium) and change the properties for the style to black with no underline. It's the same style sheet and the same style that you are working with. The only difference is that one medium is telling Flare to display that content in blue with an underline, and the other medium is telling it to use black font with no underline. With Target A using the default medium and Target B using the other medium, the content will display appropriately in each output.
See About Style Sheet Mediums and Creating Topic Styles for Print Output.
A print style is an alternative set of table styles intended for use in print-based outputs (Adobe PDF, XHTML, Microsoft XPS, Microsoft Word, Adobe FrameMaker).
example
Let's say that you insert tables into several topics and apply a table style to them that uses a green border. This might be fine for online outputs (such as DotNet Help or WebHelp), but what if you need to create printed output that displays everything in black and white? Option 1 is to create two different tables in each of those topics (one with a green border and one with a black border), and then use condition tags to separate them into the appropriate targets when you build the output. Option 2 is to manually fix your tables when you generate the printed output, changing all of the green borders to black. Option 3 is to use a print version of the table style, which is much easier and less time-consuming.
Therefore, you create a new table style to be used only for print output. It might even be identical to the your default table style, except that the print table style uses black for the borders. When you insert a new table or edit an existing one, you click the Print Style button (in the Insert Table dialog or Table Properties dialog) and select your new table style.
Following are the basic steps involved with using styles and style sheets in your project.
Create a new style sheet This entails adding to your project a new style sheet that is based on a template for an existing style sheet. Flare provides you with templates for both topic and table style sheets.
Note: You can also import an existing style sheet from outside your project.
Apply a style sheet To use the styles from a topic style sheet, you must link the style sheet to the appropriate file(s). It is recommended that you apply a master style sheet at the project or target level. The style sheet then automatically becomes available for all topics in that project or target. See Applying Master Style Sheets.
You also have the option of applying a style sheet to a single topic or to multiple topics at the same time. See Applying Style Sheets to Topics.
There are hundreds of tasks that you can perform in Flare by using styles. Following are some common tasks that you might perform when editing styles.
Look of generated glossary You can use styles to change the appearance of a glossary
Note: If you want to change the look of glossaries in online output, you can do so by modifying styles within your skin.
Look of generated index
Note: If you want to change the look of indexes in online output, you can do so by modifying styles within your skin.
Using table style sheet You can modify the look and feel of multiple tables at once by editing the properties in a custom table style sheet. These table style sheets let you easily and quickly create patterns and different looks for tables. See How to edit styles in a table style sheet.
Note: If you want to change the look of your TOC in online output, you can do so by modifying styles within your skin.
.
.
.
. Background You can change the background color for topics by using the <body> style or classes of that style. If you want the background color to be applied to all topics using a particular style sheet, you can use the main <body> style. If you want to change the background color for only some topics, create and use a class of the <body> style. See Applying Color to the Background for Topics.
You can also add a background image on topics by using the <body> style tag. See Setting a Background Image on Topics.
When applying styles to content, you may notice from time to time that the style you are looking for is not available from the drop-down list or Styles window pane when you try to select it.
example
Let's say that you have your cursor on a regular paragraph and you want to apply a list <li> style to it in order to turn it into the beginning of a bulleted list. Because it is not yet a list item, but rather a simple paragraph, you will not see your <li> style when you try to select it. Instead, you will see several paragraph styles in the list. In order to use the list style, you first need to turn the paragraph into a bulleted list item, by clicking the bullet button
in the Text Format toolbar or selecting an option such as Format>List>Bullet List.
Here is another example. If multiple paragraphs are selected or if the cursor is simply placed somewhere within a paragraph, the paragraph styles are shown in the Styles window pane. If only a portion of a paragraph is selected, the character styles are shown.
If you still do not see your style available for selection, try closing and re-launching Flare.
In addition to topic and table styles, you can use skin styles. For certain elements of the online output window (e.g., navigation pane, TOC or browse sequence entries, index keywords) you can determine skin style settings. You can edit styles in Standard skins
to make changes for WebHelp, WebHelp Plus, WebHelp AIR, DotNet Help, and HTML Help outputs. In addition, you can edit styles in WebHelp Mobile skins
to make changes for WebHelp Mobile output. When it comes to the Standard skin, please note that the vast majority of these skin styles pertain to WebHelp, WebHelp Plus, or WebHelp AIR output. Some of the settings (those that have to do with MadCap Feedback and toolbar items) also apply to HTML Help. DotNet Help output only supports skin style changes for toolbar items. See Specifying Skin Style Settings.
Note: For additional help on styles, you can download the Flare Styles Guide:
madcapsoftware.com/documentation/FlareV6/FlareStylesGuide.pdf
|
Downloads (PDF Format): Flare Transition From RoboHelp Guide |
MadCap Software, Inc. 7777 Fay Avenue La Jolla, California 92037 Tollfree 1-888-MadCap1 Tel 858-320-0387 Fax 858-320-0338
For technical support: |
The W3C and CSS Resources
See Also