3 ms·
You mean in place of <i>? That's what Bootstrap uses. Also the meaning of <i> has been shifted in HTML5 [0]. [0] http://stackoverflow.com/a/10001692/368409 htt
by lloeki 14y ago
You mean in place of <i>? That's what Bootstrap uses. Also the meaning of <i> has been shifted in HTML5 [0].
[0] http://stackoverflow.com/a/10001692/368409 http://stackoverflow.com/a/10001692/368409
- jacobr 14y agoYes, but it still has a meaning, and it is not "icon". I think you can be pragmatic here and use <i>, since it to my knowledge doesn't cause any real world problem, but it's worth exploring other options. <img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="i-icon" alt="Kitten"> .i-icon { width: 32px; height: 32px; background-image: url(http://placekitten.com/32/32); } The src is the data uri of a transparent gif. Screen readers will hear the alt text if you supply one. This will not work with font icons (img can't have ::before or ::after) but it should work fine for sprites or data uris in the CSS.