YodaSpow / EmailDevTools

EmailTools
https://codepen.io/spowart/details/abWzBwR
7 stars 1 forks source link

Alt tag checking CSS on images OFF #11

Closed YodaSpow closed 5 years ago

YodaSpow commented 5 years ago

*Alt tag checking for when images are OFF only.** Contains:£ &, #, alt

Glow maybe in another color.

YodaSpow commented 5 years ago

Turns out only Chrome accepts the :before on the image tag directly. Both Safari and Firefox do not display the tooltip on image Pseudo-elements: Thinking maybe this should be fixed with wrapping the image in the jquery .wrap like the below https://codepen.io/spowart/pen/PxvLpr

YodaSpow commented 5 years ago

Found a superior method using jquery with wrapping the img tag in a div with class only when the conditions match on the attribute selector, thus allow Safari and Firefox to add the tool tip to the div

$("img[alt*='£'], [alt*='&'], [alt*='#'], [alt*='alt']").wrap( "<div class='fauxImg'></div>" );

YodaSpow commented 5 years ago

Done.