[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mozilla-layout
Subject:    Re: external style attributes
From:       "Robert O'Callahan" <roc+ () cs ! cmu ! edu>
Date:       2000-06-22 21:16:51
[Download RAW message or body]

pete collins wrote:
> Is there a way to access style attributes that are expressed in an
> external style sheet?
> 
> If i use getAttribute() going through the dom, i can only access
> explicit inline rules.
> 
> If i have id="foo"
> 
> Can i get to:  #foo{ background-color: red; }
> 
> ??
> 
> Are external style sheet rules accessible to js?

Do you want getComputedStyle()?
http://www.w3.org/TR/DOM-Level-2/css.html#CSS-ViewCSS
Mozilla doesn't fully support it yet, but it's coming along.

Rob
-- 
[Robert O'Callahan http://www.cs.cmu.edu/~roc 6th year CMU CS PhD student
"Now when Joshua was near Jericho, he looked up and saw a man standing in
front of him with a drawn sword in his hand. Joshua went up to him and
asked, 'Are you for us or for our enemies?' 'Neither,' he replied, 'but
as commander of the army of the LORD I have now come.'" - Joshua 5:13-14]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic