• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 11. Stylin' with Style Sheets > Redefining an HTML Tag

Redefining an HTML Tag

You can add attributes to any HTML tag you use. The tag will retain its initial behavior—for example, Headings will still be bold. For now, let's modify the <b> tag. You can follow these steps for any tag you want to modify.

To redefine a tag:

On your page, type the words "hot hot hot." Then, select them and make them bold (Figure 11.16).

Figure 11.16. For our example, type the words "hot, hot, hot" in the Document window, and then make them bold (Ctrl+B or Command+B).

On the CSS Styles panel, click on New Style. The New Style dialog box will appear.

Click on the Redefine HTML tag radio button.

From the tag menu, select b (Figure 11.17). You can also type the tag in the box, without any <angle brackets>.

Figure 11.17. Choose an HTML tag, from a to var, from the drop-down menu. The menu doubles as a text box where you can type any HTML tag. For our example, type b for the bold tag, no brackets needed.

For now, let's save our style just in this document. Click on the This Document Only radio button.

Click on OK. The Style Definition dialog box will appear.

The Type panel of the dialog box should be visible. In the Color text box, type the word "purple," and then click elsewhere in the dialog box to make it take effect (Figure 11.18). Then, under Decoration, select line-through.

Figure 11.18. I made my selections in the Style Definition dialog box. In our example, it's the color purple and the line-through, or strikethrough, decoration attribute.

Click on OK to save your changes and close the Style Definition dialog box.

The text you made bold in Step 1 will now be purple. Type the word "cold," and then make it bold. Watch the text change (Figure 11.19).

Figure 11.19. Now all the text that uses the <b> tag is also purple and struck out.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint