Previous Message
Next Message

What is DOM good for?

Sent by Arlen Walker on 14 October 2005 19:07


On Oct 14, 2005, at 12:11 PM, [EMAIL-REMOVED] wrote:

> I have head alot about DOM and DOM inspectors. I have also played  
> around with Fire Fox and looked throughout the DOM interface, but I  
> am still not qute sure of the benefit of it and if it has anything  
> to do with CSS although I can see the sructuring of it.

Looking at the dom tree shows you what elements are nested inside of  
what other elements. This is helpful in crafting selectors for CSS  
rules. If, for example, you see that every blockquote you want to  
apply a blue background to lies within a div with the class of  
"quoter", you can use "div.quoter blockquote {background-color:  
blue;}" and avoid cluttering up your html with lots of extraneous  
classes/ids.

Also, if you don't like the way a particular style rule is overriding  
one you want, the DOM tree can help you create a rule with higher  
specificity to ensure it gets applied.

But one of the best uses for it is to analyse your document  
structure. CSS becomes easier when the document it gets applied to  
has a well thought out structure. The DOM Inspectors will help you  
see the structure of the document.

Have Fun,
Arlen

------------------------------
In God we trust, all others must supply data

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: