How to ensure CSS :hover is applied to dynamically added element

后端 未结 9 1053
广开言路
广开言路 2021-02-07 14:59

I have a script that adds full images dynamically over thumbnails when you hover over them. I\'ve also given the full images a CSS :hover style to make them expand to a larger w

9条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-07 15:41

    If the selectors are correct, CSS will be applied to all elements, dynamic or otherwise. This includes all pseudo classes, and will change as attributes in the DOM change.

提交回复
热议问题