|
Creating a selector style
You may have noticed that the items in the right column of the table were enclosed in CODE tags. (Click in any of the cells in that column and look at the tag selector at the bottom of the Document window. You'll see <code> among the tags listed.) Enclosing text in CODE tags causes the text to appear in a monospace font, usually Courier New in Windows and Courier on the Macintosh.
But when you defined the style for TD , you set all of the text inside table cells to appear in Courier New (or the default monospace font if Courier New or Courier is not available). This makes CODE text indistinguishable from regular table cell text. To solve this problem, you could define a style for CODE to make it a different color or font; but what if you want the occurrences of CODE in paragraphs to continue to appear in their standard monospace font with no color?
One solution is to create a style specifically for CODE when it appears inside a TD . A CSS selector style can apply to a particular tag when it occurs inside another particular tag.
To create a selector style:
| 1 |
If the Edit Style Sheet dialog box is not showing, click the Open Style Sheet button in the CSS Style palette to open it. |
| 2 |
Click New, select the Use CSS Selector option, and type TD CODE in the text field. Make sure that there is a space between TD and CODE . Click OK. |
|
A Style definition for TD CODE dialog box appears |
| 3 |
In the Color option, point to the color box and drag to select a dark red, or enter #990000 in the Color text field. |
| 4 |
Click Apply. |
|
The results are now visible in the Document window. If you like what you see, click OK. If you prefer a different color, make adjustments and click Apply again. |
 |
|
Notice that all of the CODE text in the table is now dark red, but the CODE text in the first paragraph (the terms H2 , TD , and A ) is not.
|