Forum Moderators: open

Message Too Old, No Replies

css and dynamic elements

styling dynamic elements

         

jaschulz

5:11 pm on Aug 27, 2009 (gmt 0)

10+ Year Member



My css styles do not seem to apply to elements I create at runtime? I assume this has to do with when the browser reads my css and when it reads my javascript. Is there an explanation somewhere, of how this works? Or can someone simply tell me how to get my css to apply to the elements I create at runtime.

thanks,

JAS

rocknbil

8:55 pm on Aug 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard jaschults, I think we're going to need to see some sample code, but is it possibly this [webmasterworld.com] and this [webmasterworld.com]? (read both.)

Paraphrased, if your CSS is not inline or you don't set the property as the page loads, Javascript will be "unaware" of the current style of an element. You need to do one or the other or follow the advice in the first link.

If that's not it let's see some sample code . . .