# Alt Text Issue with Blog Image

**URL:** <https://community.hubspot.com/t/alt-text-issue-with-blog-image/95288>\
**Category:** CMS Development\
**Tags:** css\
**Created:** [December 4, 2023, 9:05am UTC](https://community.hubspot.com/t/alt-text-issue-with-blog-image/95288 "2023-12-04T09:05:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JPieters](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jpieters/32/41863_2.png) [@JPieters](https://community.hubspot.com/u/JPieters)\
**Post date:** [December 4, 2023, 9:05am UTC](https://community.hubspot.com/t/alt-text-issue-with-blog-image/95288/1 "2023-12-04T09:05:24Z")

</div>

Good day,

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:

> **[Design Manager | HubSpot](https://app-eu1.hubspot.com/design-manager/24975028/code/69259238850#L25)**

So it looks to be an issue because the featured image is also listed as a background image. See below where featured\_image is listed twice:

`<div class="post-featured-image" style="background-image:url('{{content.featured_image}}');" aria-label="{% if content.featured_image_alt_text %}Featured image: {{ content.featured_image_alt_text }} - {% endif %}Read full post: {{ content.name|striptags }}" alt="{{ content.featured_image_alt_text }}"><img src="{{content.featured_image}}" style="visibility: hidden; max-width: 100%;" aria-label="{% if content.featured_image_alt_text %}Featured image: {{ content.featured_image_alt_text }} - {% endif %}Read full post: {{ content.name|striptags }}">`

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?  
Thanks,  
Kind regards  
Jenine

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [December 4, 2023, 11:14pm UTC](https://community.hubspot.com/t/alt-text-issue-with-blog-image/95288/2 "2023-12-04T23:14:35Z")

</div>

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?

Thank you for taking a look! —Jaycee

---

<div class="post-metadata">

**Author:** ![JPieters](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jpieters/32/41863_2.png) [@JPieters](https://community.hubspot.com/u/JPieters)\
**Post date:** [December 8, 2023, 9:27am UTC](https://community.hubspot.com/t/alt-text-issue-with-blog-image/95288/3 "2023-12-08T09:27:45Z")

</div>

Hi Jaycee,

Thank you for including others to help, I’m going to try the suggestion by Stephanie. 😊

---

<div class="post-metadata">

**Author:** ![Stephanie-OG](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stephanie-og/32/73267_2.png) [@Stephanie-OG](https://community.hubspot.com/u/Stephanie-OG)\
**Post date:** [December 5, 2023, 7:06pm UTC](https://community.hubspot.com/t/alt-text-issue-with-blog-image/95288/4 "2023-12-05T19:06:26Z")

</div>

Hi @JPieters

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:

1. 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.
2. 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 hope that helps!

---

<div class="post-metadata">

**Author:** ![JPieters](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jpieters/32/41863_2.png) [@JPieters](https://community.hubspot.com/u/JPieters)\
**Post date:** [December 8, 2023, 9:25am UTC](https://community.hubspot.com/t/alt-text-issue-with-blog-image/95288/5 "2023-12-08T09:25:55Z")

</div>

Hi Stephanie,

Thank you so much for your feedback, I will give it a go and see if that works. 😁
