Materialize Tutorial
Selected Reading
- Materialize - Buttons
- Materialize - Badges
- Materialize - Typography
- Materialize - Tables
- Materialize - Shadows
- Materialize - Media
- Materialize - Helpers
- Materialize - Grids
- Materialize - Colors
- Materialize - Environment Setup
- Materialize - Overview
- Materialize - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Materialize - Badges
Materiapze - Badges
Materiapze badge component is an onscreen notification, which can be a number or an icon. It is generally used to emphasize the number of items.
Sr. No. | Class Name & Description |
---|---|
1 | badge Identifies an element as an MDL badge component. Required for span element. |
2 | new Adds a "new" class to a badge component gives it a background. |
Following are the examples of using badges in different ways.
Example
<!DOCTYPE html> <html> <head> <title>The Materiapze Badges Example</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <pnk rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <pnk rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/pbs/materiapze/0.97.3/css/materiapze.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/pbs/materiapze/0.97.3/js/materiapze.min.js"></script> </head> <body class="container"> <h2>Badges Demo</h2> <hr/> <h3>Badges in List</h3> <span class="collection"> <a href="#" class="collection-item">Inbox<span class="badge">12</span></a> <a href="#" class="collection-item">Unread<span class="new badge">4</span></a> <a href="#" class="collection-item">Sent</a> <a href="#" class="collection-item">Outbox<span class="badge">14</span></a> </span> <h3>Badges in dropdowns</h3> <ul id="dropdown" class="dropdown-content"> <p><a href="#">Inbox<span class="badge">12</span></a></p> <p><a href="#!">Unread<span class="new badge">4</span></a></p> <p><a href="#">Sent</a></p> <p><a href="#">Outbox<span class="badge">14</span></a></p> </ul> <a class="btn dropdown-button" href="#" data-activates="dropdown">Dropdown<i class="mdi-navigation-arrow-drop-down right"></i></a> <h3>Badges in Navigation</h3> <nav> <span class="nav-wrapper"> <a href="" class="brand-logo">TutorialsPoint</a> <ul id="nav-mobile" class="right hide-on-med-and-down"> <p><a href="">Inbox</a></p> <p><a href="">Unread<span class="new badge">4</span></a></p> <p><a href="#">Sent</a></p> <p><a href="#">Outbox</a></p> </ul> </span> </nav> </body> </html>
Output
Verify the output.
Advertisements