What is Materialize?

Materialize is a UI component library created with CSS, JavaScript, and HTML.
Materialize reusable UI components help in constructing attractive, consistent, and functional web pages and web apps while adhering to modern web design principles such as browser portability, device independence, and graceful degradation.

Some of its salient features are as follows:

  • Standard CSS with minimal footprint;

  • New versions of common user interface controls such as buttons, checkboxes, and text fields adapted to follow Material Design concepts;

  • Enhanced and specialized features such as cards, tabs, navigation bars, toasts, and so on;

  • Free to use and requires jQuery JavaScript library to function properly;

  • Cross-browser, and can be used to create reusable web components.

Is Materialize responsive?

Yes, Materialize has in-built responsive designing so that the website created using Materialize will redesign itself as per the device size. Materialize classes are created in such a way that the website can fit any screen size.

The websites created using Materialize are fully compatible with PC, tablets, and mobile devices.

Extensible

Materialize is by design very minimal and flat. It is designed considering the fact that it is much easier to add new CSS rules than to overwrite the existing CSS rules. It supports shadows and bold colors. The colors and shades remain uniform across various platforms and devices.

And most important of all, it is absolutely free to use.

How to Use Materialize?

There are two ways to use Materialize:

1.Local Installation − You can download the materialize.min.css and materialize.min.js files on your local machine and include it in your HTML code.

2.CDN Based Version − You can include the materialize.min.css and materialize.min.js files into your HTML code directly from the Content Delivery Network (CDN).

Local Installation

Example

Include the css and js file in your HTML file as follows.


<!DOCTYPE html>
<html>
   <head>
     <title>The Materialize Example</title>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">      
      <link rel = "stylesheet"
         href = "https://fonts.googleapis.com/icon?family=Material+Icons">
      <link rel = "stylesheet" href = "/materialize/materialize.min.css">
      <script type = "text/javascript"
         src = "https://code.jquery.com/jquery-2.1.1.min.js"></script>           
      <script src = "/materialize/materialize.min.js"></script>            
   </head>
  
   <body>
      <div class = "card-panel teal lighten-2"><h3>Hello World!</h3></div>
   </body>
</html>

CDN Based Version

You can include the materialize.min.js and materialize.min.css files into your HTML code directly from the Content Delivery Network (CDN). cdnjs.cloudflare.com provides content for the latest version.

We are using cdnjs.cloudflare.com CDN version of the library throughout this tutorial.

Example

Rewrite the above example using materialize.min.css and materialize.min.js from cdnjs.cloudflare.com CDN.


<!DOCTYPE html>
<html>
   <head>
      <title>The Materialize Example</title>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">      
      <link rel = "stylesheet"
         href = "https://fonts.googleapis.com/icon?family=Material+Icons">
      <link rel = "stylesheet"
         href = "https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
      <script type = "text/javascript" src = "https://code.jquery.com/jquery-2.1.1.min.js">
      </script>           
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js">
      </script>             
   </head>
   
   <body>
      <div class = "card-panel teal lighten-2"><h3>Hello World!</h3></div>
   </body>
</html>

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *