Applying Color to the Background for Topics

You can change the background color for topics by using the main body style or classes of that style. If you want the background color to be applied to all topics using a particular stylesheet, 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.

How to Apply a Background Color for All Topics

  1. From the Content Explorer, open the stylesheet that you want to modify.
  2. Complete one of the following sets of steps, depending on whether you want to use the Simplified view or Advanced view in the Stylesheet Editor.

    • Simplified The Simplified view displays styles in a grid view and is often best for brand new users.

      This view provides an easy way to apply properties to styles, with format options available from a toolbar and dialogs (similar to the way one would use an interface such as Microsoft Word). In some cases, only the most common property options are available in the Simplified view (e.g., font, letter/word spacing, paragraph alignment/indentation, autonumbering format, borders, background). One advantage of the Simplified view is that you can apply a property to multiple styles at the same time. You can also click a check box to hide the properties in the editor, allowing you to see only the styles.

    • Advanced The Advanced view displays styles in a tree structure, and despite the name, is user friendly for authors of all levels.

      For the properties, you can toggle between a grouped display and an alphabetical display. The Advanced view of the Stylesheet Editor lets you edit more settings than are available in the Simplified view. In addition, the Advanced view lets you see and apply settings to multiple mediums and media queries at the same time.

  3. If Using Simplified View

    1. In the local toolbar, make sure the first button displays (which means that the Simplified view is currently shown in the editor). If the button displays instead, then click it.
    2. In the upper-left of the editor, make sure the drop-down field is set to .
    3. From the grid in the bottom portion of the editor, find and select the body tag.
    4. In the local toolbar of the editor, click . The Properties dialog opens.
    5. Select the Font tab.
    6. In the Background field, click the down arrow and select a color from the popup. For advanced color options, select More Colors and use the fields in the Color Picker dialog.
    7. In the Properties dialog, click OK.

    If Using Advanced View

    1. In the local toolbar, make sure the first button displays . If the button displays instead, then click it.
    2. In the upper-left of the editor, make sure the drop-down field is set to .
    3. On the left side of the editor, find and select the body tag.
    4. From the Show drop-down list on the upper-right side of the editor, select .
    5. (Optional) You can use the toggle button in the local toolbar to show properties below in a group view or an alphabetical view .
    6. If you are using the grouped view, expand the Background group.
    7. To the right of background-color, click .
    8. Select a color. For advanced color options, click and use the fields in the Color Picker dialog, or click to select a color already used elsewhere on your screen.
  4. Click to save your work.

How to Apply a Background Color for Only Some Topics

  1. From the Content Explorer, open the stylesheet that you want to modify.
  2. Complete one of the following sets of steps, depending on whether you want to use the Simplified view or Advanced view in the Stylesheet Editor.

    • Simplified The Simplified view displays styles in a grid view and is often best for brand new users.

      This view provides an easy way to apply properties to styles, with format options available from a toolbar and dialogs (similar to the way one would use an interface such as Microsoft Word). In some cases, only the most common property options are available in the Simplified view (e.g., font, letter/word spacing, paragraph alignment/indentation, autonumbering format, borders, background). One advantage of the Simplified view is that you can apply a property to multiple styles at the same time. You can also click a check box to hide the properties in the editor, allowing you to see only the styles.

    • Advanced The Advanced view displays styles in a tree structure, and despite the name, is user friendly for authors of all levels.

      For the properties, you can toggle between a grouped display and an alphabetical display. The Advanced view of the Stylesheet Editor lets you edit more settings than are available in the Simplified view. In addition, the Advanced view lets you see and apply settings to multiple mediums and media queries at the same time.

  3. If Using Simplified View

    1. In the local toolbar, make sure the first button displays (which means that the Simplified view is currently shown in the editor). If the button displays instead, then click it.
    2. In the upper-left of the editor, make sure the drop-down field is set to .
    3. From the grid in the bottom portion of the editor, find and select the body tag.
    4. In the local toolbar, click Add Selector. The New Selector dialog opens.
    5. In the Class Name field, enter a name for the new style class and click OK. The new class is added under the body style.
    6. In the grid in the bottom portion of the editor, make sure the new style class is selected.
    7. In the local toolbar of the editor, click . The Properties dialog opens.
    8. Select the Font tab.
    9. In the Background field, click the down arrow and select a color from the popup. For advanced color options, select More Colors and use the fields in the Color Picker dialog.
    10. In the Properties dialog, click OK.

    If Using Advanced View

    1. In the local toolbar, make sure the first button displays . If the button displays instead, then click it.
    2. In the upper-left of the editor, make sure the drop-down field is set to .
    3. On the left side of the editor, find and select the body tag.
    4. In the local toolbar, click Add Selector. The New Selector dialog opens.
    5. In the Class Name field, enter a name for the new style class and click OK. The new class is added under the body style.
    6. On the left side of the editor, make sure the new style class is selected.
    7. From the Show drop-down list on the upper-right side of the editor, select .
    8. (Optional) You can use the toggle button in the local toolbar to show properties below in a group view or an alphabetical view .
    9. If you are using the grouped view, expand the Background group.
    10. To the right of background-color, click .
    11. Select a color. For advanced color options, click and use the fields in the Color Picker dialog, or click to select a color already used elsewhere on your screen.
  4. Click to save your work.
  5. Open the topic to which you want to apply the background color.
  6. If the tag block bars are not shown to the left of the content, click at the bottom of the editor.
  7. Right-click the body tag bar (the second bar from the left).
  8. In the context menu, select Style Class > body.[name of class].
  9. Click to save your work.

What’s Noteworthy?

Note If you want to select a background color for selected text only, see Setting the Background Color for Text.

Note These steps change the background for the entire topic in online output. For print output that uses page layouts, these steps affect the background of the frames only, not the margins outside of the frames. If you want to change the background for print output that extends to the margins, you can specify background settings in your page layouts (see Specifying Page Background Settings). Let's say that you want a yellow background on all topics for both online and print-based output, extending all the way to the edges of the screen or page. For online output, you would use the steps above to set the background color for the body style to yellow. For the print output, you would set the background on the pages in your layout to yellow and set the page margins to 0.