图标字体应该使用什么标签?

2014-04-17 17:38:02 +08:00
 paicha
Font Awesome 使用的是 <i> 标签

例子:<i class="fa fa-camera-retro"></i> fa-camera-retro
http://fortawesome.github.io/Font-Awesome/examples/



Bootstrap 使用的是 <span> 标签

例子:<span class="glyphicon glyphicon-search"></span>
http://getbootstrap.com/components/#glyphicons-how-to-use

个人倾向于 <span> 标签。

<i> 标签不是斜体标签吗?为什么会用到字体图标里?
2880 次点击
所在节点    问与答
6 条回复
deepure
2014-04-17 17:42:47 +08:00
图标字体没有特定的标签,使用i只是习惯。
P233
2014-04-17 18:02:55 +08:00
HTML5 给了 i 新的语义
Mutoo
2014-04-17 21:36:31 +08:00
因为 i 很短。而且里面是空的。
jsonline
2014-04-17 22:47:00 +08:00
因为i看起来像是icon的缩写啊
jsonline
2014-04-17 22:55:49 +08:00
HTML5 里的 i 好像是一种不同的语气或发音,总之我理解不了文档到底在说什么!
http://html5doctor.com/i-b-em-strong-element/

```
The i element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, a thought, a ship name, or some other prose whose typical typographic presentation is italicized.
```
otakustay
2014-04-18 11:15:01 +08:00
HTML来说都不提倡用一个标签就放个图标吧,我是伪元素搞定的

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/108978

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX