How Does JavaScript Call Forth CSS??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts

  • Nik Coughlin
    Guest replied
    Re: How Does JavaScript Call Forth CSS??

    "Prisoner at War" <prisoner_at_wa r@yahoo.comwrot e in message
    news:c86208c9-45fb-4419-acb6-6d62c94d4ef0@m4 4g2000hsc.googl egroups.com...
    >
    Okay, Folks,
    >
    I guess my real burning concern all along is a "high-level" one: just
    how does JavaScript interact with CSS?
    >
    Right now, my newbie self only knows JavaScript and CSS to *co-
    exist*...but I'm beginning to get the sense that they actually
    interact -- or, perhaps more precisely, JavaScript acts upon CSS...but
    how, exactly??
    >
    I see how JavaScript acts upon HTML, but I'm not so sure where
    JavaScript acts upon CSS...moreover, I want to see where they could
    create whole new browsing experiences, beyond simply new text and new
    images (though I'm only just beginning at the level of new ways of
    presenting text and images)....
    >
    How do I go about all this?? Ugh, I hope all those $$$ worth of books
    will help...so far, I'm learning very basic things which I actually
    wouldn't use (though the learning itself is fun), while the things I
    would like to do, I either don't have the technical know-how for it or
    I don't have the creative imagination to bring together what little I
    do know -- sigh!!
    Basically, you get the element in Javascript, and set its style property.

    <div id="content">bl ah</div>

    JavaScript:

    var contentDiv = document.getEle mentById( "content" );
    contentDiv.styl e.marginLeft = "1em";

    Generally (there may be exceptions but I'm not aware of any) the property of
    the object corresponds to the name of the CSS property but camel cased.

    Leave a comment:


  • Prisoner at War
    Guest started a topic How Does JavaScript Call Forth CSS??

    How Does JavaScript Call Forth CSS??


    Okay, Folks,

    I guess my real burning concern all along is a "high-level" one: just
    how does JavaScript interact with CSS?

    Right now, my newbie self only knows JavaScript and CSS to *co-
    exist*...but I'm beginning to get the sense that they actually
    interact -- or, perhaps more precisely, JavaScript acts upon CSS...but
    how, exactly??

    I see how JavaScript acts upon HTML, but I'm not so sure where
    JavaScript acts upon CSS...moreover, I want to see where they could
    create whole new browsing experiences, beyond simply new text and new
    images (though I'm only just beginning at the level of new ways of
    presenting text and images)....

    How do I go about all this?? Ugh, I hope all those $$$ worth of books
    will help...so far, I'm learning very basic things which I actually
    wouldn't use (though the learning itself is fun), while the things I
    would like to do, I either don't have the technical know-how for it or
    I don't have the creative imagination to bring together what little I
    do know -- sigh!!
Working...