HowToColorText

You can specify the color of text foreground and background using the CSS syntax. For example, this:

This is normal text.
%%(color:red)
This text is red.
%%
This is normal text again.

produces this:

This is normal text.

This text is red.
This is normal text again.

Specifying colors#

The CSS property name is "color" for foreground (text) colors, "background-color" for background colors. In CSS, if you specify multiple properties they must be delimited by a semicolon. For example, the syntax to produce red text on a yellow background would be:

%%( color: red ; background-color : yellow ) Gary Snyder %%
as in: Gary Snyder

You can use any valid CSS color specification, e.g., see the CSS color names:

maroon "#800000" red "#FF0000" orange "#FFA500" yellow "#FFFF00" olive "#808000"
purple "#800080" fuchsia "#FF00FF" white "#FFFFFF" lime "#00FF00" green "#008000"
navy "#000080" blue "#0000FF" aqua "#00FFFF" teal "#008080"
black "#000000" silver "#C0C0C0" gray "#808080"

Inline text formatting#

This is normal text. %%(color:red;)This inline text is red.%% This is normal text again.

produces this:

This is normal text. This inline text is red. This is normal text again.


Note: previous examples required %%(color:red; display:inline)...%%. This is not necessary any more (tested in 2.2.28), for inline usage now a span tag is rendered instead of a div tag. -- Gregor Hagedorn


Go back to DontTellMeShowMe