This year we recently had a company rebranded and had our HubSpot templates changed by HubSpot to suit the new look.
However, we have recently had an issue with the image alt text bringing up an error message with our blog posts. I spoke with HubSpot support, and they confirmed that the alt text is being applied. The error is coming from the img tag in the template:
The first listing "style="background-image:url('{{content.featured_image}}');" is where it is being flagged for not having alt text.
They recommend I consult with a developer to see if the first listing is cause for concern or if the error can be ignored. Additionally, I was told to reach out on this forum. Has anyone else had the same roadblock before?
I can't open the template since I don't have access to your portal, but looking at the code (and assuming the div element is closed somwhere) I notice that:
The alt attribute is being used on the div element instead of the img. It should be moved to the img element instead. This should solve the error you're seeing.
For the div with the background image, I think the aria-label attribute should be enough (*). But you can also do things like add a title attribute or have a hidden element inside (e.g. on the HubSpot boilerplate they use a "show-for-sr" CSS class).
(*) I'm going to add a little legal disclaimer here to point out that I'm not a web accesibility compliance expert
I can't open the template since I don't have access to your portal, but looking at the code (and assuming the div element is closed somwhere) I notice that:
The alt attribute is being used on the div element instead of the img. It should be moved to the img element instead. This should solve the error you're seeing.
For the div with the background image, I think the aria-label attribute should be enough (*). But you can also do things like add a title attribute or have a hidden element inside (e.g. on the HubSpot boilerplate they use a "show-for-sr" CSS class).
(*) I'm going to add a little legal disclaimer here to point out that I'm not a web accesibility compliance expert
Hi, @JPieters👋 Thanks for your question! I'd like to invite some of our community members to the conversation — hey @Jnix284@Stephanie-OG@alyssamwilie, can you suggest a next step or troubleshooting tip for @JPieters?