They give us control over how the document looks when it is first put on to the screen, but what about after that?
However, CSS can be affected by any scripting language that your particular browser can handle - VBScript in Internet Explorer, for instance.
The bad news - and you knew it would not be straightforward - is that Navigator and Internet Explorer have implemented their DOMs differently.
The key is that the HTML element must have a unique identity (ie, name) on the screen.
When you write a letter to someone, you address the envelope describing the person, the house number, street and city for whom the letter is intended.
Any elements on the screen, at least any that are enclosed within HTML tags, can be identified using a NAME or an ID attribute to give it its own unique "address", as if it were on a city map. The DOM works like a map of your web page, describing a path starting with the window itself and then the HTML document down to the various elements on the Web page.
For instance, the DOM for an image called button1 would be: window.document.images.button1.
Unfortunately, because the DHTML browsers - Netscape Navigator 4 and Internet Explorer 4 - don't agree on the same map to get to elements defined using CSS, they have different formats for creating addresses to elements on a Web page. Thus we have yet another cross-browser problem to contend with when dealing with DHTML.
Netscape uses the following format to access elements defined using CSS: document. elementName.styleProperty while Internet Explorer uses the following format to get to the same place: document.all.elementName.style.styleProperty, where "elementName" refers to the name given to the HTML element and "styleProperty" is the CSS style you want to change for that specific element.
The World wide Web Consortium (http://www.w3c.org) is working on a DOM standard, and both Netscape and Microsoft have agreed to adhere to that standard. This will probably more closely resemble the format currently used in Internet Explorer, but that does not really help us right now.
Jason Cranford Teague's book 'The Visual Quickstart Guide to DHTML' has just been published by Peach Pit Press.
E-mail your comments or queries to Jason at indy_webdesign @mindspring.comReuse content