Html html5中的数据图标是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4754979/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
what is data-icon in html5?
提问by Lucka
What is "data-icon" in HTML5 and how can I use it? If you know any source where I can read more about it, please let me know. Thanks.
什么是 HTML5 中的“数据图标”,我该如何使用它?如果您知道我可以阅读更多相关信息的任何来源,请告诉我。谢谢。
回答by deceze
data-
attributesare attributes for private use. I.e., anybody can make up any data-
attribute and do with it whatever he wants. I suppose you came across this as part of jQuery mobile's markup for icons on buttons.
data-
属性是供私人使用的属性。即,任何人都可以组成任何data-
属性并随心所欲地使用它。我想您在jQuery mobile 的按钮图标标记中遇到了这个问题。
回答by Puyol
Have a look at this:
http://pictos.cc/server/
看看这个:http:
//pictos.cc/server/
Data-icons are a way to add a background image to an element using fonts. The great benefits are that those images can be scaled and colored without loss of resolution.
数据图标是一种使用字体向元素添加背景图像的方法。最大的好处是这些图像可以在不损失分辨率的情况下缩放和着色。