Created
December 17, 2024 00:09
-
-
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"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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