I am trying to add an image separator between <section>s and rather than my usual non-semantic way of adding a paragraph with an image, I wanted to try a better way. I have
which is fine as far as it goes, but I want the image centred on the page. I’ve tried margin: 0 auto and text-align: center without success but I’ve run out of ideas.
The reason I say that is, I’m not sure how you then make the image responsive.
The image being the content of the pseudo element and not the element itself, you don’t have control over it via the css selector, whereas a background image you can control.
Though this may depend on the size and nature of the image and how you wish it to behave at varying sizes.
It should be OK then. But in my example I used a wide horizontal bar so it has to respond the screen width.
I don’t know of a way to select the image content of a pseudo element.