codecamp

Pure.CSS图标

PURE.CSS支持以下流行的图标库:

  • 字体Awesome图标

  • 谷歌图标材料

  • 引导图标

用法

要使用图标,将图标名称放在HTML<i>元素的类中。

purecss_icons.htm

<html>
   <head>
      <title>The PURE.CSS Icons</title>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="https://yui.yahooapis.com/pure/0.6.0/pure-min.css">
	  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
	  <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
	  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
      <style>  
         .xsmall {
            font-size: 70%;
         }
         .small {
            font-size: 85%;
         }
         .large {
            font-size: 110%;
         }
         .xlarge {
            font-size: 125%;
         }
      </style>
   </head>
   <body> 
      <h2>Icons Demo</h2>
      <hr/>
      <h3>Font Awesome Icon Demo</h3>
      <i class="fa fa-cloud xsmall"></i>
      <i class="fa fa-cloud small"></i>
	  <i class="fa fa-cloud"></i>
      <i class="fa fa-cloud large"></i>
      <i class="fa fa-cloud xlarge"></i>
      <h3>Google Material Design Icon Demo</h3>      
      <i class="material-icons xsmall">cloud</i>	
      <i class="material-icons small">cloud</i>
      <i class="material-icons large">cloud</i>
      <i class="material-icons xlarge">cloud</i>
	  <i class="material-icons">cloud</i>
      <h3>Bootstrap Icon Demo</h3>
      <i class="glyphicon glyphicon-cloud xsmall"></i>
      <i class="glyphicon glyphicon-cloud small"></i>
	  <i class="glyphicon glyphicon-cloud"></i>
      <i class="glyphicon glyphicon-cloud large"></i>
      <i class="glyphicon glyphicon-cloud xlarge"></i>
	  <h3>Button with Icon Demo</h3>
      <button class="pure-button"><i class="fa fa-cog"></i> Settings</button>
      <a class="pure-button" href="#"><i class="fa fa-shopping-cart fa-lg"></i> Checkout</a>
   </body>
</html>

结果


验证结果。

Icons Demo


Font Awesome Icon Demo

    

Google Material Design Icon Demo

cloud cloud cloud cloud cloud

Bootstrap Icon Demo

Button with Icon Demo

  Checkout




Pure.CSS图片
Pure.CSS有用的资源
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

Pure.CSS Useful Resources

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }