Check out example codes for "html img pseudo class". It will help you in understanding the concepts better.

Code Example 1

Doesn't work. Only containing tags can have psuedo class children.

e.g. <div>, <p>, <span>, etc...

Learn ReactJs, React Native from akashmittal.com