1

Will using a pseudo element like before to place background image on top of an img element for SEO value have negative consequences?

The reason being we want the flexibility of an element with a background image that can maintain its proportion well still getting the SEO value from an img element with an alt attribute.

This mainly become an issue in responsive and the magazine style layout that we are trying to maintain. It makes use of overlapping images.

2

I don't see how it would, as long the alt tags are relevant to the image in the HTML, and you are not deceiving your site visitors it would not raise any flags. The background image is coded in CSS behind the main image so it has no value in as far as ranking.

  • It would be using css to completely cover the actual image element so it would not be visible to the user only the pseudo element which will be z-indexed on top of the image tag will be seen by visitors. – cuts4th Jul 21 '17 at 18:11
  • Try to avoid such practices any content only visible to the search engines and not the visitor will get your site flagged. – gabehou Jul 21 '17 at 18:21
  • The pseudo element would display the same image as the image element. From what you're saying, I'm guessing that wouldn't matter to google's bots when they're crawling the page? – cuts4th Jul 24 '17 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.