Horje
Onsen UI CSS Component Material Segment

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.

The segment is used to create a group of related content. Onsen UI CSS Component Material Segment is used to create the material segment using the below classes.

Onsen UI CSS Component Material Segment Classes:

  • segment–material: This class is used to create the material segment.
  • segment–material__item: This class is used to create the material segment item.
  • segment–material__input: This class is used to create the material segment input.
  • segment–material__button: This class is used to create the material segment button.

Syntax:

<div class="segment segment--material">
  <div class="segment__item 
                segment--material__item">
    <input type="..." 
           class="segment__input 
                  segment--material__input">
    <div class="segment__button 
                segment--material__button">
        ...
    </div>
  </div>
  ...
</div>

Example 1: The following example demonstrates the Onsen UI CSS Component Material Segment.

HTML

<!DOCTYPE html>
<html>
  
<head>
    <!-- CDN links of Onsen UI library -->
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
    <script src=
    </script>
</head>
  
<body>
    <center>
        <h2 style="color: green;">
            GeeksforGeeks
        </h2>
        <strong>
            Onsen UI CSS Component Material Segment
        </strong> <br> <br>
  
        <div class="segment segment--material" 
             style="width: 120px;">
            <div class="segment__item 
                        segment--material__item">
                <input type="checkbox" 
                       class="segment__input 
                       segment--material__input">
                <div class="segment__button 
                            segment--material__button">
                    Java
                </div>
            </div>
  
            <div class="segment__item 
                        segment--material__item">
                <input type="checkbox" 
                       class="segment__input 
                       segment--material__input">
                <div class="segment__button 
                            segment--material__button">
                    Python
                </div>
            </div>
        </div>
    </center>
</body>
  
</html>

Output:

 

Example 2: The following example demonstrates the Onsen UI CSS Component Material Segment.

HTML

<!DOCTYPE html>
<html>
  
<head>
    <!-- CDN links of Onsen UI library -->
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
    <script src=
    </script>
</head>
  
<body>
    <center>
        <h2 style="color: green;">
            GeeksforGeeks
        </h2>
        <strong>
            Onsen UI CSS Component Material Segment
        </strong> <br> <br>
  
        <div class="segment segment--material" 
             style="width: 500px;">
            <div class="segment__item 
                        segment--material__item">
                <input type="radio" 
                       class="segment__input 
                       segment--material__input"
                       name="rd1">
                <div class="segment__button 
                            segment--material__button">
                    Java
                </div>
            </div>
  
            <div class="segment__item 
                        segment--material__item">
                <input type="radio" 
                       class="segment__input 
                       segment--material__input"
                       name="rd1">
                <div class="segment__button 
                            segment--material__button">
                    Python
                </div>
            </div>
  
            <div class="segment__item 
                        segment--material__item">
                <input type="radio" 
                       class="segment__input 
                       segment--material__input"
                       name="rd1">
                <div class="segment__button 
                            segment--material__button">
                    C
                </div>
            </div>
  
            <div class="segment__item 
                        segment--material__item">
                <input type="radio" 
                       class="segment__input 
                       segment--material__input"
                       name="rd1">
                <div class="segment__button 
                            segment--material__button">
                    C++
                </div>
            </div>
        </div>
    </center>
</body>
  
</html>

Output:

 

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




Reffered: https://www.geeksforgeeks.org


CSS

Related
Onsen UI CSS Component Action Sheet with Delete Label Onsen UI CSS Component Action Sheet with Delete Label
Onsen UI Dialog CSS Component Material Alert Dialog Onsen UI Dialog CSS Component Material Alert Dialog
Onsen UI Range CSS Components Onsen UI Range CSS Components
Primer CSS Layout Position Primer CSS Layout Position
Tachyons Typography Garamond Tachyons Typography Garamond

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
8