Material Design Lite Environmental Setup
What is Environmental Setup in (MDL) ?
- There are two ways to use Material Design Lite:
- Local Installation - You can download the material.{primary}-{accent}.min.css and material.min.js files on your local machine and include it in your HTML code.
- CDN Based Version - You can include the material.{primary}-{accent}.min.css and material.min.js files into your HTML code directly from the Content Delivery Network (CDN).
Local Installation:
- Then, put the downloaded material.min.js file in a directory of your website, e.g. /js and material.min.cssin /css.
Sample code:
- Now you can include the css and js file in your HTML file as follows −
Output:
CDN Based Version:
- You can include the js and css files into your HTML code directly from the Content Delivery Network (CDN). storage.googleapis.com provides content for the latest version.
- We are using storage.googleapis.com CDN version of the library throughout this tutorial.
Sample Code:
- Rewriting the above example using material.css and material.js from Google CDN.