Skip to content

Instantly share code, notes, and snippets.

@mikeoberdick
Created December 17, 2024 00:09
Show Gist options
  • Save mikeoberdick/745b412fc71151ef6ca3f13d5b77f6d1 to your computer and use it in GitHub Desktop.
Save mikeoberdick/745b412fc71151ef6ca3f13d5b77f6d1 to your computer and use it in GitHub Desktop.
Adding alt text to background images using an aria-label and role = "img"
<div class="outer-wrapper bg-image" style = "background-image: url('<?php echo $sectionOne['image']['url']; ?>');" role = "img" aria-label = "<?php echo $sectionOne['image']['alt']; ?>"></div><!-- .outer-wrapper -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment