Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] DOM: adding CSS to created DIV
- From: david at dorward.me.uk (David Dorward)
- Subject: [Javascript] DOM: adding CSS to created DIV
- Date: Mon Jan 22 03:56:19 2007
On Mon, Jan 22, 2007 at 09:50:36AM +0100, Michael Borchers wrote: > >AFAIK it will, I've never used it (as setting a .className has usually > >done the trick for me when I wanted to set lots of styles at once). > before i try: creating the div "on the fly" and just adding the > class name as attribute As mentioned, IE's support for setAttribute is lacking. Set the .className property instead. > would be enough to see the div with the > styles i have adjusted to the CSS class? There is no such thing as a "CSS class". Classes are part of HTML. CSS has "class selectors" which (along with the other selectors in CSS) control what elements a declaration-block applies to. Making an HTML element a member of a class will cause styles in any declaration-block associated with a selector that matches that class to be applied on the fly though. -- David Dorward http://dorward.me.uk
- References:
- [Javascript] DOM: adding CSS to created DIV
- From: David Dorward
- [Javascript] DOM: adding CSS to created DIV
- From: Michael Borchers
- [Javascript] DOM: adding CSS to created DIV
- Prev by Date: [Javascript] DOM: adding CSS to created DIV
- Next by Date: [Javascript] z-index and form elements
- Previous by thread: [Javascript] DOM: adding CSS to created DIV
- Next by thread: [Javascript] z-index and form elements
- Index(es):