8 ms·
What are you supposed to do about image alt text when the image is purely decorative, like a border? This complains about alt="".
by ARCarr 9y ago
What are you supposed to do about image alt text when the image is purely decorative, like a border?
This complains about alt="".
- wbkang 9y agoSome people would say use a div and background image CSS property. Not sure if that's the recommended solution though.
- sdoering 9y agoWell - I would try to omit the image at all and use border style properties to do it. This way I would omit an request totally. But maybe someone with real experience (not some hobbyist when it comes to front end work) should chime in.
- amichal 9y agoPer https://www.w3.org/wiki/HTML/Elements/img https://www.w3.org/wiki/HTML/Elements/img > A purely decorative image that doesn't add any information In general, if an image is decorative but isn't especially page-specific, for example an image that forms part of a site-wide design scheme, the image should be specified in the site's CSS, not in the markup of the document. However, a decorative image that isn't discussed by the surrounding text but still has some relevance can be included in a page using the img element. Such images are decorative, but still form part of the content. In these cases, the alt attribute must be present but its value must be the empty string. I have always understood that (and earlier spec incarnations) to mean that <img alt=''> is correct for these cases.