I bring some data ajax `in div. Roughly speaking, these are divas too. So the question is: how to make the page, after adding such data, apply css styles to newly added divas (they do not pick up css). Preferably with js.

Thanks to all.

    4 answers 4

    No need to force. In the normal state, css is applied to all elements, both original and dynamically inserted. If you insert data and styles are not applied to them, then the styles you have are not written for those elements.

    • Wow, +10 !! - Yura Ivanov
    • 2
      @Yura Ivanov, yeah)) Perelman had fewer honors for proving Poincaré’s hypothesis)) - Deonis
    • in my opinion, just for such cases, a “Discipline” sign was invented ... +12 and it grows, finally, tin. - Yura Ivanov

    there is a dynamic connection of styles


    there is also such a thing as! important


    of course you can immediately connect all the styles

      Not strong in js, but maybe something like Update to a general class like windows and redraw it.

      • the fact of the matter is that reluctant to redraw (so as not to cause flicker). I would like to have a "refresh" css - dolphin4ik

      Styles are applied automatically. Perhaps the problem is that when loading with ajax, there are no spaces between the inline-block . In this case, the blocks will not be aligned with text-align . Add a space in the loaded data and everything will be ok.