The before and after pseudo-selectors don't insert HTML elements — they insert text before or after the existing content of the targeted element. Because image elements don't contain text or have descendants, neither img:before
or img:after
will do you any good. This is also the case for elements like <br>
and <hr>
for the same reason.