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

11. Managing Style Sheets > 11.10. Turning Arbitrary Content into a Styled Elem...

Turning Arbitrary Content into a Styled Element

NN 4, IE 3

Problem

You want to assign a style to a section of body content that is not currently delimited by HTML tags.

Solution

Wrap the content inside a <span> or <div> tag pair, and assign a style to that element type, class, or ID:

<p>And now for something <span class="hot">completely</span> different.</p>

Discussion

Despite the large number of contextual tags provided by HTML 4.0 (such as the <address> and <blockquote> tags), the tags don’t necessarily have names that describe the true context within your document. Although you can use XML capabilities of IE 5 and later for Windows and NN 6 or later to fill this gap (by designing your own tags), you can also use HTML tags to define these contexts for you.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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