Material Design Lite – Checkboxes ”; Previous Next MDL provides a range of CSS classes to apply various predefined visual and behavioral enhancements and display the different types of checkboxes. The following table lists down the available classes and their effects. Sr.No. Class Name & Description 1 mdl-checkbox Identifies label as an MDL component and is required on label element. 2 mdl-js-checkbox Sets basic MDL behavior to label and is required on label element. 3 mdl-checkbox__input Sets basic MDL behavior to checkbox and is required on input element (checkbox). 4 mdl-checkbox__label Sets basic MDL behavior to caption and is required on span element (caption). 5 mdl-js-ripple-effect Sets ripple click effect and is optional; goes on the label element and not on the input element (checkbox). Example The following example will help you understand the use of the mdl-slider classes to show the different types of check boxes. mdl_checkboxes.htm Live Demo <html> <head> <script src = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js”> </script> <link rel = “stylesheet” href = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css”> <link rel = “stylesheet” href = “https://fonts.googleapis.com/icon?family=Material+Icons”> <script langauage = “javascript”> function showMessage(value) { document.getElementById(“message”).innerHTML = value; } </script> </head> <body> <table> <tr><td>Default CheckBox</td><td>CheckBox with Ripple Effect</td> <td>Disabled CheckBox</td></tr> <tr> <td> <label class = “mdl-checkbox mdl-js-checkbox” for = “checkbox1”> <input type = “checkbox” id = “checkbox1” class = “mdl-checkbox__input” checked> <span class = “mdl-checkbox__label”>Married</span> </label> </td> <td> <label class = “mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect” for = “checkbox2”> <input type = “checkbox” id = “checkbox2” class = “mdl-checkbox__input”> <span class = “mdl-checkbox__label”>Single</span> </label> </td> <td> <label class = “mdl-checkbox mdl-js-checkbox” for = “checkbox3”> <input type = “checkbox” id = “checkbox3” class = “mdl-checkbox__input” disabled> <span class = “mdl-checkbox__label”>Don”t know (Disabled)</span> </label> </td> </tr> </table> </body> </html> Result Verify the result. Print Page Previous Next Advertisements ”;
Category: materialdesignlite
MDL – Icons
Material Design Lite – Icons ”; Previous Next MDL provides a range of CSS classes to apply various predefined visual and behavioral enhancements and display the different types of checkboxes as icons. The following tables lists down the available classes and their effects. Sr.No. Class Name & Description 1 mdl-icon-toggle Identifies label as an MDL component and is required on label element. 2 mdl-js-icon-toggle Sets basic MDL behavior to label and is required on label element. 3 mdl-icon-toggle__input Sets basic MDL behavior to icon-toggle and is required on input element (icon-toggle). 4 mdl-icon-toggle__label Sets basic MDL behavior to caption and is required on on i element (icon). 5 mdl-js-ripple-effect Sets ripple click effect and is optional; goes on the label element and not on the input element (icon-toggle). Example The following example showcases the use of mdl-icon-toggle classes to show different types of checkboxes as icons. mdl_icons.htm Live Demo <html> <head> <script src = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js”> </script> <link rel = “stylesheet” href = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css”> <link rel = “stylesheet” href = “https://fonts.googleapis.com/icon?family=Material+Icons”> </head> <body> <table> <tr><td>On Icon</td><td>Off Icon</td> <td>Disabled Icon</td></tr> <tr> <td> <label class = “mdl-icon-toggle mdl-js-icon-toggle mdl-js-ripple-effect” for = “icon-toggle-1”> <input type = “checkbox” id = “icon-toggle-1” class = “mdl-icon-toggle__input” checked> <i class = “mdl-icon-toggle__label material-icons”>format_bold</i> </label> </td> <td> <label class = “mdl-icon-toggle mdl-js-icon-toggle mdl-js-ripple-effect” for = “icon-toggle-2”> <input type = “checkbox” id = “icon-toggle-2” class = “mdl-icon-toggle__input”> <i class = “mdl-icon-toggle__label material-icons”>format_italic</i> </label> </td> <td> <label class = “mdl-icon-toggle mdl-js-icon-toggle mdl-js-ripple-effect” for = “icon-toggle-2”> <input type = “checkbox” id = “icon-toggle-2” class = “mdl-icon-toggle__input” disabled> <i class = “mdl-icon-toggle__label material-icons”>format_underline</i> </label> </td> </tr> </table> </body> </html> Result Verify the result. Print Page Previous Next Advertisements ”;
MDL – Discussion
Discuss Material Design Lite ”; Previous Next Material Design Lite, MDL is a UI component library created with CSS, JavaScript, and HTML. MDL UI components helps in constructing attractive, consistent, and functional web pages and web apps while adhering to modern web design principles like browser portability, device independence, and graceful degradation. It helps in creating faster, beautiful, and responsive websites. It is inspired from the Google Material Design. Print Page Previous Next Advertisements ”;
MDL – Textfields
Material Design Lite – Textfields ”; Previous Next MDL provides a range of CSS classes to apply various predefined visual and behavioral enhancements and display the different types of text inputs. The following table lists down the available classes and their effects. Sr.No. Class Name & Description 1 mdl-textfield Identifies container as an MDL component and is required on “outer” div element. 2 mdl-js-textfield Sets basic MDL behavior to input and is required on “outer” div element. 3 mdl-textfield__input Identifies element as textfield input and is required on input or textarea element. 4 mdl-textfield__label Identifies element as textfield label and is required on label element for input or textarea elements. 5 mdl-textfield–floating-label Applies floating label effect and is optional; goes on “outer” div element. 6 mdl-textfield__error Identifies span as an MDL error message and is optional; goes on span element for MDL input element with pattern. 7 mdl-textfield–expandable Identifies a div as an MDL expandable text field container; used for expandable input fields, and is required on “outer” div element. 8 mdl-button Identifies label as an MDL icon button; used for expandable input fields, and is required on “outer” div”s label element. 9 mdl-js-button Sets basic behavior to icon container; used for expandable input fields, and is required on “outer” div”s label element. 10 mdl-button–icon Identifies label as an MDL icon container; used for expandable input fields, and is required on “outer” div”s label element. 11 mdl-input__expandable-holder Identifies a container as an MDL component; used for expandable input fields, and is required on “inner” div element. 12 is-invalid Identifies the textfield as invalid on initial load and is optional on mdl-textfield element. Example The following example will help you understand the use of the mdl-textfield classes to show the different types of textfields. mdl_textfields.htm Live Demo <html> <head> <script src = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js”> </script> <link rel = “stylesheet” href = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css”> <link rel = “stylesheet” href = “https://fonts.googleapis.com/icon?family=Material+Icons”> <script langauage = “javascript”> function showMessage(value) { document.getElementById(“message”).innerHTML = value; } </script> </head> <body> <table> <tr><td>Simple Text Field</td><td>Numeric Text Field</td> <td>Disabled Text Field</td></tr> <tr> <td> <form action = “#”> <div class = “mdl-textfield mdl-js-textfield”> <input class = “mdl-textfield__input” type = “text” id = “text1”> <label class = “mdl-textfield__label” for = “text1”>Text…</label> </div> </form> </td> <td> <form action = “#”> <div class = “mdl-textfield mdl-js-textfield”> <input class = “mdl-textfield__input” type = “text” pattern = “-?[0-9]*(.[0-9]+)?” id = “text2”> <label class = “mdl-textfield__label” for = “text2”> Number…</label> <span class = “mdl-textfield__error”>Number required!</span> </div> </form> </td> <td> <form action = “#”> <div class = “mdl-textfield mdl-js-textfield”> <input class = “mdl-textfield__input” type = “text” id = “text3” disabled> <label class = “mdl-textfield__label” for = “text3”> Disabled…</label> </div> </form> </td> </tr> <tr><td>Simple Text Field with Floating Label</td> <td>Numeric Text Field with Floating Label</td> <td> </td></tr> <tr> <td> <form action = “#”> <div class = “mdl-textfield mdl-js-textfield mdl-textfield–floating-label”> <input class = “mdl-textfield__input” type = “text” id = “text4”> <label class = “mdl-textfield__label” for = “text4”>Text…</label> </div> </form> </td> <td> <form action = “#”> <div class = “mdl-textfield mdl-js-textfield mdl-textfield–floating-label”> <input class = “mdl-textfield__input” type = “text” pattern = “-?[0-9]*(.[0-9]+)?” id = “text5”> <label class = “mdl-textfield__label” for = “text5”> Number…</label> <span class = “mdl-textfield__error”>Number required!</span> </div> </form> </td> <td> </td> </tr> <tr><td>Multiline Text Field</td><td>Expandable Multiline Text Field</td> <td> </td></tr> <tr> <td> <form action = “#”> <div class = “mdl-textfield mdl-js-textfield”> <textarea class = “mdl-textfield__input” type = “text” rows = “3” id = “text7” ></textarea> <label class = “mdl-textfield__label” for = “text7”>Lines…</label> </div> </form> </td> <td> <form action = “#”> <div class = “mdl-textfield mdl-js-textfield mdl-textfield–expandable”> <label class = “mdl-button mdl-js-button mdl-button–icon” for = “text8”> <i class = “material-icons”>search</i> </label> <div class = “mdl-textfield__expandable-holder”> <input class = “mdl-textfield__input” type = “text” id = “text8”> <label class = “mdl-textfield__label” for = “sample-expandable”> Expandable Input</label> </div> </div> </form> </td> <td> </td> </tr> </table> </body> </html> Result Verify the result. Print Page Previous Next Advertisements ”;
MDL – Cards
Material Design Lite – Cards ”; Previous Next MDL provides a range of CSS classes to apply various predefined visual and behavioral enhancements and display the different types of cards. The following table lists down the available classes and their effects. Sr.No. Class Name & Description 1 mdl-card Identifies div element as an MDL card container, required on “outer” div. 2 mdl-card–border Puts a border to the card section that it is applied to and is used on the “inner” divs. 3 mdl-shadow–2dp through mdl-shadow–16dp Sets variable shadow depths (2, 3, 4, 6, 8, or 16) to card and is optional, goes on “outer” div; if omitted, no shadow is shown. 4 mdl-card__title Identifies div as a card title container and is required on “inner” title div. 5 mdl-card__title-text Puts appropriate text characteristics to card title and is required on head tag (H1 – H6) inside title div. 6 mdl-card__subtitle-text Puts text characteristics to a card subtitle and is optional. It should be a child of the title element. 7 mdl-card__media Identifies div as a card media container and is required on “inner” media div. 8 mdl-card__supporting-text Identifies div as a card body text container and assigns appropriate text characteristics to body text and is required on “inner” body text div; text goes directly inside the div with no intervening containers. 9 mdl-card__actions Identifies div as a card actions container and assigns appropriate text characteristics to actions text and is required on “inner” actions div; content goes directly inside the div with no intervening containers. Example The following example will help you understand the use of the mdl-tooltip classes to show different types of tooltips. mdl_cards.htm Live Demo <html> <head> <script src = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js”> </script> <link rel = “stylesheet” href = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css”> <link rel = “stylesheet” href = “https://fonts.googleapis.com/icon?family = Material+Icons”> <style> .wide-card.mdl-card { width: 512px; } .square-card.mdl-card { width: 256px; height: 256px; } .image-card.mdl-card { width: 256px; height: 256px; background: url(”html5-mini-logo.jpg”) center / cover; } .image-card-image__filename { color: #000; font-size: 14px; font-weight: bold; } .event-card.mdl-card { width: 256px; height: 256px; background: #3E4EB8; } .event-card.mdl-card__title { color: #fff; height: 176px; } .event-card > .mdl-card__actions { border-color: rgba(255, 255, 255, 0.2); display: flex; box-sizing:border-box; align-items: center; color: #fff; } </style> </head> <body> <table> <tr><td>Wide Card with Share Button</td><td>Square Card</td></tr> <tr> <td> <div class = “wide-card mdl-card mdl-shadow–2dp”> <div class = “mdl-card__title”> <h2 class = “mdl-card__title-text”>H5</h2> </div> <div class = “mdl-card__supporting-text”> HTML5 is the next major revision of the HTML standard superseding HTML 4.01, XHTML 1.0, and XHTML 1.1. HTML5 is a standard for structuring and presenting content on the World Wide Web. </div> <div class = “mdl-card__actions mdl-card–border”> <a class = “mdl-button mdl-button–colored mdl-js-button mdl-js-ripple-effect”> Learn HTML5</a> </div> <div class = “mdl-card__menu”> <button class = “mdl-button mdl-button–icon mdl-js-button mdl-js-ripple-effect”> <i class = “material-icons”>share</i></button> </div> </div> </td> <td> <div class = “square-card mdl-card mdl-shadow–2dp”> <div class = “mdl-card__title”> <h2 class = “mdl-card__title-text”>H5</h2> </div> <div class = “mdl-card__supporting-text”> HTML5 is the next major revision of the HTML standard superseding HTML 4.01, XHTML 1.0, and XHTML 1.1. HTML5 is a standard for structuring and presenting content on the World Wide Web. </div> <div class = “mdl-card__actions mdl-card–border”> <a class = “mdl-button mdl-button–colored mdl-js-button mdl-js-ripple-effect”> Learn HTML5</a> </div> <div class = “mdl-card__menu”> <button class = “mdl-button mdl-button–icon mdl-js-button mdl-js-ripple-effect”> <i class = “material-icons”>share</i></button> </div> </div> </td> </tr> <tr><td>Image Card</td><td>Event Card</td></tr> <tr> <td> <div class = “image-card mdl-card mdl-shadow–2dp”> <div class = “mdl-card__title mdl-card–expand”></div> <div class = “mdl-card__actions”> <span class = “image-card-image__filename”>html5-logo.jpg</span> </div> </div> </td> <td> <div class = “event-card mdl-card mdl-shadow–2dp”> <div class = “mdl-card__title mdl-card–expand”> <h4>HTML 5 Webinar:<br/>June 14, 2016<br/>7 – 11 pm IST</h4> </div> <div class = “mdl-card__actions mdl-card–border”> <a class = “mdl-button mdl-button–colored mdl-js-button mdl-js-ripple-effect”> Add to Calendar</a> <div class = “mdl-layout-spacer”></div> <i class = “material-icons”>event</i> </div> </div> </td> </tr> </table> </body> </html> Result Verify the result. Print Page Previous Next Advertisements ”;
MDL – Tabs
Material Design Lite – Tabs ”; Previous Next The Material Design Lite (MDL) tab component is a user interface component which helps to show multiple screens in a single space in an exclusive manner. MDL provides various CSS classes to apply various predefined visual and behavioral enhancements to the tabs. The following table mentions the available classes and their effects. Sr.No. Class Name & Description 1 mdl-layout Identifies a container as an MDL component. Required on outer container element. 2 mdl-tabs Identifies a tabs container as an MDL component. Required on “outer” div element. 3 mdl-js-tabs Sets basic MDL behavior to tabs container. Required on “outer” div element. 4 mdl-js-ripple-effect Adds ripple click effect to tab links. Optional; goes on “outer” div element. 5 mdl-tabs__tab-bar Identifies a container as an MDL tabs link bar. Required on first “inner” div element. 6 mdl-tabs__tab Identifies an anchor (link) as an MDL tab activator. Required on all links in first “inner” div element. 7 is-active Identifies a tab as the default display tab. Required on one (and only one) of the “inner” div (tab) elements. 8 mdl-tabs__panel Identifies a container as tab content. Required on each of the “inner” div (tab) elements. Example The following example will help you understand the use of the mdl-tab class to layout contents on various tabs. The MDL classes given below will be used in this example − mdl-layout − Identifies a div as an MDL component. mdl-js-layout − Adds basic MDL behavior to outer div. mdl-layout–fixed-header − Makes the header always visible, even in small screens. mdl-layout__header-row − Identifies container as MDL header row. mdl-layout-title − Identifies layout title text. mdl-layout__content − Identifies div as MDL layout content. mdl-tabs − Identifies a tabs container as an MDL component. mdl-js-tabs − Sets basic MDL behavior to tabs container. mdl-tabs__tab-bar − Identifies a container as an MDL tabs link bar. mdl-tabs__tab − Identifies an anchor (link) as an MDL tab activator. is-active − Identifies a tab as the default display tab. mdl-tabs__panel − Identifies a container as tab content. mdl_tabs.htm Live Demo <html> <head> <link rel = “stylesheet” href = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css”> <script src = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js”> </script> <link rel = “stylesheet” href = “https://fonts.googleapis.com/icon?family=Material+Icons”> </head> <body> <div class = “mdl-layout mdl-js-layout mdl-layout–fixed-header”> <header class = “mdl-layout__header”> <div class = “mdl-layout__header-row”> <span class = “mdl-layout-title”>Material Design Tabs</span> </div> </header> <main class = “mdl-layout__content”> <div class = “mdl-tabs mdl-js-tabs”> <div class = “mdl-tabs__tab-bar”> <a href = “#tab1-panel” class = “mdl-tabs__tab is-active”>Tab 1</a> <a href = “#tab2-panel” class = “mdl-tabs__tab”>Tab 2</a> <a href = “#tab3-panel” class = “mdl-tabs__tab”>Tab 3</a> </div> <div class = “mdl-tabs__panel is-active” id = “tab1-panel”> <p>Tab 1 Content</p> </div> <div class = “mdl-tabs__panel” id = “tab2-panel”> <p>Tab 2 Content</p> </div> <div class = “mdl-tabs__panel” id = “tab3-panel”> <p>Tab 3 Content</p> </div> </div> </main> </div> </body> </html> Result Verify the result. Print Page Previous Next Advertisements ”;
MDL – Grids
Material Design Lite – Grids ”; Previous Next The Material Design Lite (MDL) grid is a component for laying out content for varying screen sizes. The MDL grid is defined and enclosed by a container/div element. A grid has 12 columns in the desktop size screen, 8 in the tablet size screen, and 4 in the phone size screen, where each size has predefined margins and gutters. Cells are laid out in sequential manner in a row, in the order they are defined, with following exceptions: If a grid cell is not fit for the row in one of the screen sizes, it flows into the following line. If a grid cell has a specified column size equal to or larger than the number of columns for the screen size, it takes up the entire row. MDL provides various CSS classes to apply various predefined visual and behavioral enhancements to the grid. The following table lists down the available classes and their effects. Sr.No. Class Name & Description 1 mdl-layout Identifies a container as an MDL component. Required on outer container element. 2 mdl-grid Identifies a container as an MDL grid component. Required on “outer” div element. 3 mdl-cell Identifies a container as an MDL cell. Required on “inner” div elements. 4 mdl-grid–no-spacing Updates the grid cells to have no margin between them. Optional for grid container. 5 mdl-cell–N-col This helps put the column size for the cell to N, N is 1-12 inclusive, defaults to 4; optional for “inner” div elements. 6 mdl-cell–N-col-desktop This helps put the column size for the cell to N in desktop mode only, N is 1-12 inclusive; optional for “inner” div elements. 7 mdl-cell–N-col-tablet This helps put the column size for the cell to N in tablet mode only, N is 1-8 inclusive; optional for “inner” div elements. 8 mdl-cell–N-col-phone This helps put the column size for the cell to N in phone mode only, N is 1-4 inclusive; optional for “inner” div elements. 9 mdl-cell–hide-desktop Hides the cell when in desktop mode. Optional for “inner” div elements. 10 mdl-cell–hide-tablet Hides the cell when in tablet mode. Optional for “inner” div elements. 11 mdl-cell–hide-phone Hides the cell when in phone mode. Optional for “inner” div elements. 12 mdl-cell–stretch Stretches the cell vertically to fill the parent, default; optional for “inner” div elements. 13 mdl-cell–top Aligns the cell to the top of the parent. Optional for “inner” div elements. 14 mdl-cell–middle Aligns the cell to the middle of the parent. Optional for “inner” div elements. 15 mdl-cell–bottom Aligns the cell to the bottom of the parent. Optional for “inner” div elements. Example The following example will help you understand the use of the mdl-grid class to layout contents on various screens. The MDL classes given below will be used in this example. mdl-layout − Identifies a div as an MDL component. mdl-js-layout − Adds basic MDL behavior to outer div. mdl-layout–fixed-header − Makes the header always visible, even in small screens. mdl-layout__header-row − Identifies container as MDL header row. mdl-layout__drawer − Identifies div as MDL layout drawer. mdl-layout-title − Identifies layout title text. mdl-navigation − Identifies div as MDL navigation group. mdl-navigation__link − Identifies anchor as MDL navigation link. mdl-layout__content − Identifies div as MDL layout content. mdl-grid − Identifies div as an MDL grid component. mdl-cell − Identifies div as MDL cell. mdl-cell–1-col − Sets the column size for the cell to that of 1 cell out of 12 cells in desktop screen size. mdl-cell–2-col − Sets the column size for the cell to that of 2 cell out of 12 cells in desktop screen size. mdl-cell–4-col − Sets the column size for the cell to that of 4 cell out of 12 cells in desktop screen size. mdl-cell–6-col − Sets the column size for the cell to that of 6 cell out of 12 cells in desktop screen size. mdl-cell–4-col-phone − Sets the column size for the cell to that of 4 cell out of 4 cells in phone screen size. mdl-cell–6-col-tablet − Sets the column size for the cell to that of 6 cell out of 8 cells in tablet screen size. mdl-cell–8-col-tablet − Sets the column size for the cell to that of 8 cell out of 8 cells in tablet screen size. mdl_grid.htm Live Demo <html> <head> <link rel = “stylesheet” href = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css”> <script src = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js”> </script> <link rel = “stylesheet” href = “https://fonts.googleapis.com/icon?family=Material+Icons”> <style> .graybox { background-color:#ddd; } </style> </head> <body> <div class = “mdl-layout mdl-js-layout mdl-layout–fixed-header”> <header class = “mdl-layout__header”> <div class = “mdl-layout__header-row”> <span class = “mdl-layout-title”>Material Design Grid</span> </div> </header> <div class = “mdl-layout__drawer”> <span class = “mdl-layout-title”>Material Design Tutorial</span> <nav class = “mdl-navigation”> <a class = “mdl-navigation__link” href = “”>Home</a> <a class = “mdl-navigation__link” href = “”>About</a> </nav> </div> <main class = “mdl-layout__content”> <div class = “mdl-grid”> <div class = “mdl-cell mdl-cell–1-col graybox”>1</div> <div class = “mdl-cell mdl-cell–1-col graybox”>2</div> <div class = “mdl-cell mdl-cell–1-col graybox”>3</div> <div class = “mdl-cell mdl-cell–1-col graybox”>4</div> <div class = “mdl-cell mdl-cell–1-col graybox”>5</div> <div class = “mdl-cell mdl-cell–1-col graybox”>6</div> <div class = “mdl-cell mdl-cell–1-col graybox”>7</div> <div class = “mdl-cell mdl-cell–1-col graybox”>8</div> <div class = “mdl-cell mdl-cell–1-col graybox”>9</div> <div class = “mdl-cell mdl-cell–1-col graybox”>10</div> <div class = “mdl-cell mdl-cell–1-col graybox”>11</div> <div class = “mdl-cell mdl-cell–1-col graybox”>12</div> </div> <div class = “mdl-grid”> <div class = “mdl-cell mdl-cell–4-col graybox”>1</div> <div class = “mdl-cell mdl-cell–4-col graybox”>2</div> <div class = “mdl-cell mdl-cell–4-col graybox”>3</div> </div> <div class = “mdl-grid”> <div class = “mdl-cell mdl-cell–6-col graybox”>6</div> <div class = “mdl-cell mdl-cell–4-col graybox”>4</div> <div class = “mdl-cell mdl-cell–2-col graybox”>2</div> </div> <div class = “mdl-grid”> <div class = “mdl-cell mdl-cell–6-col mdl-cell–8-col-tablet graybox”> 6 on desktop, 8 on tablet</div> <div class = “mdl-cell mdl-cell–4-col mdl-cell–6-col-tablet graybox”> 4 on desktop, 6 on tablet</div> <div class = “mdl-cell mdl-cell–2-col mdl-cell–4-col-phone graybox”> 2 on desktop, 4 on phone</div> </div> </main> </div> </body> </html> Result Verify the result. Print Page Previous Next Advertisements
MDL – Home
Material Design Lite Tutorial PDF Version Quick Guide Resources Job Search Discussion Material Design Lite, MDL is a UI component library created with CSS, JavaScript, and HTML. MDL UI components helps in constructing attractive, consistent, and functional web pages and web apps while adhering to modern web design principles like browser portability, device independence, and graceful degradation. It helps in creating faster, beautiful, and responsive websites. It is inspired from the Google Material Design. Audience This tutorial is designed for professionals who aspire to learn the basics of Material Design Lite and how to use it to create faster, beautiful, and responsive websites. The tutorial explains all the fundamental concepts of Material Design Lite. Prerequisites Before proceeding with this tutorial, you should have a basic understanding of HTML, CSS, JavaScript, Document Object Model (DOM), and any text editor. In addition, it will help if you know how web-based applications work. Print Page Previous Next Advertisements ”;
MDL – Spinners
Material Design Lite – Spinners ”; Previous Next MDL provides a range of CSS classes to apply various predefined visual and behavioral enhancements and display the different types of spinners. The following table lists down the available classes and their effects. Sr.No. Class Name & Description 1 mdl-spinner Identifies a container as MDL spinner component and is a required class. 2 mdl-js-spinner Sets basic MDL behavior to spinner and is a required class. 3 is-active Shows and animates the spinner and is optional. 4 mdl-spinner–single-color Uses a single color instead of changing colors and is optional. Example The following example will help you understand the use of the mdl-spinner classes and the different types of spinners. mdl_spinners.htm Live Demo <html> <head> <script src = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js”> </script> <link rel = “stylesheet” href = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css”> <link rel = “stylesheet” href = “https://fonts.googleapis.com/icon?family=Material+Icons”> </head> <body> <h4>Default Spinner</h4> <div class = “mdl-spinner mdl-js-spinner is-active”></div> <h4>Single Color Spinner</h4> <div class = “mdl-spinner mdl-spinner–single-color mdl-js-spinner is-active”></div> </body> </html> Result Verify the result. Print Page Previous Next Advertisements ”;
MDL – Tooltips
Material Design Lite – Tooltips ”; Previous Next MDL provides a range of CSS classes to apply various predefined visual and behavioral enhancements and display the different types of tooltips. The following table lists down the available classes and their effects. Sr.No. Class Name & Description 1 mdl-tooltip Identifies container as an MDL tooltip and is required on tooltip container element. 2 mdl-tooltip–large Sets large-font effect and is optional; goes on tooltip container element. Example The following example will help you understand the use of the mdl-tooltip classes to show the different types of tooltips. mdl_tooltips.htm Live Demo <html> <head> <script src = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js”> </script> <link rel = “stylesheet” href = “https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css”> <link rel = “stylesheet” href = “https://fonts.googleapis.com/icon?family=Material+Icons”> <script langauage = “javascript”> function showMessage(value) { document.getElementById(“message”).innerHTML = value; } </script> </head> <body> <table> <tr><td>Simple Tooltip</td><td>Large Tooltip</td></tr> <tr> <td> <div id = “tooltip1” class = “icon material-icons”>add</div> <div class = “mdl-tooltip” for = “tooltip1”>Follow</div> </td> <td> <div id = “tooltip2” class = “icon material-icons”>print</div> <div class = “mdl-tooltip mdl-tooltip–large” for = “tooltip2”>Print</div> </td> </tr> <tr> <td>Rich Tooltip</td><td>Multiline Tooltip</td></tr> <tr> <td> <div id = “tooltip3” class = “icon material-icons”>cloud_upload </div> <div class = “mdl-tooltip” for = “tooltip3”>Upload <i>zip files</i></div> </td> <td> <div id = “tooltip4” class = “icon material-icons”>share</div> <div class = “mdl-tooltip” for = “tooltip4″> Share your content<br>using social media</div> </td> </tr> </table> </body> </html> Result Verify the result. Print Page Previous Next Advertisements ”;