As with the :after/ pseudo-elements :before, there are apparently two ways if I want to display the image there:
:after
:before
background-image:url(imgurl.png);
content:url(imgurl.png);
Are both ways right and right? Why should I use one path over another?
Apparently, using the second method, you cannot set image properties such as size. But the first method is more general on the Internet.
Ideas?
It depends on what your image is, as well as discussions between using a tag <img>and using background-imagein your CSS.
<img>
background-image
, content:url(imgurl.png);. , , , content. , background-image:url(imgurl.png);
content
, : ::before ::after. IE8 .
::before
::after