Open In App

Onsen UI List CSS Components

In this article, we will learn how to include lists using Onsen UI. Onsen UI CSS is used to create beautiful HTML components. It is one of the most efficient ways to create HTML5 hybrid components that are compatible with both mobile and desktop.

Lists are used to store data or information on web pages in ordered or unordered form.



Syntax:

<element-name class="class-name">...</element-name>

Classes Used:



Example 1: In the below example, we will create a simple list.




<!DOCTYPE html>
<html>
  
<head>
    <!-- CDN links of Onsen UI library -->
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
    </script>
</head>
  
<body>
    <center>
        <h1 style="color: green;">
            GeeksforGeeks
        </h1>
  
        <h3>Onsen UI CSS Component </h3>
        <ul class="list">
            <li class="list-item">
                <div class="list-item__center">DSA</div>
            </li>
            <li class="list-item">
                <div class="list-item__center">Java</div>
            </li>
            <li class="list-item">
                <div class="list-item__center">C++</div>
            </li>
        </ul>
    </center>
</body>
  
</html>

Output:

 

Example 2: In the below example, we will make use of the above classes to demonstrate the use to create a list.




<!DOCTYPE html>
<html>
   
<head>
    <!-- CDN links of Onsen UI library -->
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
    <script src=
    </script>
</head>
  
<body>
    <center>
        <h1 style="color: green;">
            GeeksforGeeks
        </h1>
        <h3>
            Onsen UI CSS Component
        </h3> <br> <br>
        <ul class="list">
            <li class="list-header">
                Header
            </li>
            <li class="list-item">
                <div class="list-item__center">Item</div>
            </li>
            <li class="list-item">
                <div class="list-item__center">Item</div>
            </li>
            <li class="list-item">
                <div class="list-item__center">Item</div>
            </li>
        </ul>
    </center>
</body>
  
</html>

Output:

 

Reference: https://onsen.io/v2/api/css.html#list-category


Article Tags :