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

Chapter 26. Advanced Microsoft Dynamic HTML > Using Dynamic HTML with Styles

Using Dynamic HTML with Styles

Dynamic HTML works very well with another aspect of Internet Explorer for dynamically changing the formatting of elements in an HTML document: styles and style sheets. One property associated with all HTML tags—which, as you will recall, you can access through the all object —is that tag's style. The style property, in turn, has properties of its own that you can access and change to immediately change the appearance of the Web page.

Listing 26.4 shows an example of dynamically changing the style of elements of an HTML document. In this example, the format is applied to two elements in different ways—either through an embedded style sheet created with the <STYLE> tag or through the STYLE attribute. No matter which way you do it, the script changes the format in response to the onMouseDown and onMouseUp events. Figure 26.5 and Figure 26.6 show the before and after screen shots of this HTML document.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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