Alt Text & Title tags for background block images

  • On our blogs, we use a background image on certain GP blocks. For SEO, we would really like for the alt text and title to be included in the page source for the image. We are adding these to the media library before linking to the background.
    Alt Text and Title added to Media Library Image

    Container Block background set to the image from the media library.
    Container Block Background set to image from media library

    The page source includes the url but not associated alt text and title.
    page source image url doesn't include attributes for alt & title

    I can edit attributes for the entire block, but this isn’t ideal as it’s not associated with the image itself.
    alt and title added to container html attributes

    The alt text and title will display in page source associated with the entire container, but not the image.
    alt and title in page source associated with the block, not the image

    Is there an alternate way I should approach this?

  • Hi there,

    The background image is generated by CSS; it will NOT contain those attributes.

    You will need to use an actual image block to have the image attributes in the HTML.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.