Thursday, March 16, 2017

W3.CSS - Icons

W3.CSS supports the following popular icon libraries:
  • Font Awesome Icons
  • Google Material Icons
  • Bootstrap Icons

Usage

To use an icon, put the name of the icon in the class of an HTML <i> element. To control the size of an icon, you can use the following classes:
Class NameDescription
w3-tinyDraws an icon of very small size.
w3-smallDraws an icon of small size.
w3-largeDraws an icon of large size.
w3-xlargeDraws an icon of extra large size.
w3-xxlargeDraws an icon of very extra large size.
w3-xxxlargeDraws an icon of very high extra large size.

Example

w3css_icons.htm
<html>
   <head>
      <title>The W3.CSS Icons</title>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="https://www.w3schools.com/lib/w3.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">
   </head>
   <body class="w3-container"> 
      <h2>Icons Demo</h2>
      <hr/>
      <h3>Font Awesome Icon Demo</h3>
      <i class="fa fa-cloud"></i>
      <i class="fa fa-cloud w3-large"></i>
      <i class="fa fa-cloud w3-xlarge"></i>
      <i class="fa fa-cloud w3-xxlarge"></i>
      <i class="fa fa-cloud w3-xxxlarge"></i>
      <i class="fa fa-cloud w3-text-teal" style="font-size:64px"></i>
      <h3>Google Material Design Icon Demo</h3>      
      <i class="material-icons w3-large">cloud</i>
   <i class="material-icons">cloud</i>
      <i class="material-icons w3-xlarge">cloud</i>
      <i class="material-icons w3-xxlarge">cloud</i>
      <i class="material-icons w3-xxxlarge">cloud</i>
      <i class="material-icons w3-text-teal" style="font-size:64px">cloud</i>
      <h3>Bootstrap Icon Demo</h3>
      <i class="glyphicon glyphicon-cloud"></i>
      <i class="glyphicon glyphicon-cloud w3-large"></i>
      <i class="glyphicon glyphicon-cloud w3-xlarge"></i>
      <i class="glyphicon glyphicon-cloud w3-xxlarge"></i>
      <i class="glyphicon glyphicon-cloud w3-xxxlarge"></i>
      <i class="glyphicon glyphicon-cloud w3-text-teal" style="font-size:64px"></i> 
   </body>
</html>

Result

Verify the result.

Icons Demo


Font Awesome Icon Demo

Google Material Design Icon Demo

cloud cloud cloud cloud cloud cloud

Bootstrap Icon Demo

No comments:

Post a Comment