SEO help for images

Posted: 14 March 19 Modified: 9 April 19 Posted by: Category: Archives

To improve your SEO efforts, the “Simplr” theme v2.7 introduce an highlighting images with missing alt attribute by surrounding such pictures by a large dashed red border.

We achieve that feature with a simple CSS rule:

html img:not([alt]) {
	outline: 4px dashed red;
}

and with a test into image tags to render the alt attribute only if it contains some text:

<img src="..." <txp:evaluate test='<txp:image_info type="alt" />'><txp:else />alt="<txp:image_info type='alt' />"</txp:evaluate> />

Never forget to add a full stop at the end of your alternative textes to indicate screen readers can make a short pause (see: Web Accessibility Guide).


Related articles:

Page 1 of 6