Using <i> vs <span> for icons.
See original GitHub issueUsing <i>
for icon is a not good, fcc shouldn’t teach/encourage bad practice, use <span>
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (13 by maintainers)
Top Results From Across the Web
Should I use the span tag or the i tag for an icon? [duplicate]
<i> isn't the icon tag, it's the italic tag, and it doesn't make much difference which you pick. <span> is more semantically correct, ......
Read more >Is it incorrect to use <I> tags for icons?
span and i tag are used to for defining an icon as it does not need to be a block element. So I...
Read more >Should I use i tag for icons instead of span
The I element represents a span of text in a different voice or mood, or otherwise offset from the normal prose, such as...
Read more >Icons Tutorial
The <i> and <span> elements are widely used to add icons. All the icons in the icon libraries below, are scalable vector icons...
Read more >ARIA24: Semantically identifying a font icon with role="img"
The objective of this technique is to show how to semantically identify an element that uses a font file for icons. When a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@darrenbkl I don’t think anyone uses the
span
tag to display icons. In fact, contrary to what you say, every major icon provider (Font Awesome, Google Icons…etc) uses thei
tag for it.To empathize(italicize) text, you should use the
em
tag.I agree with @AkiraLaine.