Alt Text on Banner Swap
Master HTML Email Banner Accessibility Techniques
Unlike regular images in HTML emails, background images cannot be assigned ALT text, creating accessibility challenges when images fail to load in mobile email clients.
Key Concepts You'll Learn
Invisible Shim Technique
Learn to use 1x1 pixel transparent GIFs to create ALT text for background images. This technique provides accessibility when images are disabled.
Mobile-Specific Display
Understand how to show ALT text only on mobile devices using CSS media queries and display properties.
Cross-Client Compatibility
Implement solutions that work across different email clients while maintaining proper image fallbacks.
Environment Setup Process
Close Existing Files
Close all open files in your code editor to avoid confusion between different project files
Open Target File
Navigate to Desktop > Class Files > yourname-Responsive HTML Email Class folder and open date-night-exclusive-picks.html
Disable Browser Images
Access Chrome Settings > Site Settings > Images and toggle off 'Show all' to simulate email clients with images disabled
While 1x1 pixel GIFs were popular in early HTML email development, they have fallen out of favor and are not recommended as best practice. Use this technique only when necessary for ALT text accessibility.
Regular Image vs Shim Image Approach
| Feature | Regular Image | Shim Image Method |
|---|---|---|
| ALT Text Support | Direct ALT attribute | ALT via invisible image |
| Background Image | Not applicable | Provides ALT text solution |
| File Size Impact | None | Minimal (1x1 pixel) |
| Accessibility | Built-in | Requires CSS control |
CSS Implementation Steps
Hide Shim by Default
Add 'display: none' rule for img.shim class in general styles around line 59 to hide the invisible image on desktop
Show on Mobile
Add 'display: block!important' and 'width: 100%!important' rules within the max-width: 480px media query
Avoid Spacing Issues
Ensure no space between 'block' and '!important' to prevent display issues in Yahoo email client
Make sure you do not have a space between 'block' and '!important' in your CSS to avoid display issues specifically in Yahoo email client.
Testing and Validation Checklist
Verify ALT text appears when images are blocked by email clients
Confirm media query activation and proper ALT text display
Ensure invisible image remains hidden on larger screens
Confirm normal image display functionality is restored
Key Takeaways

and from the menu choose Settings.