文件类型图标的纯 CSS 版本:fileicon.css

jopen 9年前

介绍

文件类型图标的纯 CSS 版本。可以不用图片来创建文件图标。(例如:doc, pdf, png, zip 等等)。

查看 DEMO

使用

<div class="file-icon file-icon-xl" data-type="doc"></div>

显示为:

doc

类型

使用data-type来定义文件类型,已经定义了一些:

  • doc, docx
  • xls, xlsx
  • ppt, pptx
  • pdf
  • zip

尺寸

使用file-icon-xx来使用尺寸,支持:

  • xs (12x16)
  • sm (18x24)
  • 默认 (24x32)
  • lg (48x64)
  • xl (120x160)

自定义

如果要定义自己的类型,只需要:

.file-icon[data-type=custom] { background: #38A240;  }
文件类型图标的纯 CSS 版本:fileicon.css

项目主页:http://www.open-open.com/lib/view/home/1419843872265