create CSS declaration in JavaScript (in IE6)?

Discussion in 'Javascript' started by stephen.cunliffe@gmail.com, Jun 15, 2006.

  1. Guest

    Hi all,

    Quick question. I know that IE6's support for CSS is well... hmmm...
    lets just say not very good, however I was wondering if style
    declarations can be added at run time, via JS?

    e.g.
    Can I create a new rule?

    Thanks,
    Steve
     
    , Jun 15, 2006
    #1
    1. Advertising

  2. wrote:


    > Quick question. I know that IE6's support for CSS is well... hmmm...
    > lets just say not very good, however I was wondering if style
    > declarations can be added at run time, via JS?
    >
    > e.g.
    > Can I create a new rule?


    Yes, you can, IE supports the document.styleSheets collection and each
    sheet object has a method addRule e.g.
    styleSheetObject.addRule('selector', 'declarations')
    see the MSDN documentation
    <http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/addrule.asp>
    for more details.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jun 15, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ivor O'Connor
    Replies:
    4
    Views:
    873
    Isofarro
    Nov 25, 2003
  2. Peter Mount
    Replies:
    4
    Views:
    975
    Peter Mount
    Jan 31, 2006
  3. Pugi!
    Replies:
    0
    Views:
    246
    Pugi!
    Feb 5, 2007
  4. κÖлª
    Replies:
    2
    Views:
    134
    Thomas 'PointedEars' Lahn
    Jan 3, 2008
  5. timothytoe
    Replies:
    4
    Views:
    166
Loading...

Share This Page