Open In App

Semantic-UI Dropdown Floating Type

Semantic UI is an open-source framework that uses CSS and jQuery to build great user interfaces. It is the same as a bootstrap for use and has great different elements to use to make your website look more amazing.

A Semantic UI Dropdown allows a user to select a value from a series of options. It offers 11 types of dropdowns and 3types of content Header, divider, and icon.  In this article, we will learn about Floating Type.



The Floating Type is used for creating a dropdown menu that can appear to be floating below an element.

Semantic-UI Dropdown Floating Type class:



Syntax:

<div class="ui floating dropdown icon button">
  <i class="dropdown icon"></i>
   <div class="menu">
     <div class="item">
       <i class="edit icon"></i> 
          Edit Post
    </div>
</div>

Example 1: The below example illustrates the Semantic-UI Dropdown Floating Type.




<!DOCTYPE html>
<html>
  
<head>
    <link href=
          rel="stylesheet" />
    <script src=
    </script>
    <script src=
    </script>
</head>
  
<body>
    <center>
        <div class="ui container">
            <h1 style="color:green;">
                GeeksforGeeks
            </h1>
            <h3>Semantic-UI Dropdown Floating Type</h3>
                <div class="ui button">Update</div>
                <div class="ui floating dropdown icon button">
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <div class="item">
                          <i class="angle left icon"></i
                              Left angle icon
                          </div>
                        <div class="item">
                          <i class="angle right icon"></i
                              Right angle icon
                          </div>
                    </div>
                </div>
            </div>
        <script>
            $('.ui.dropdown').dropdown();
        </script>
    </center>
</body>
  
</html>

Output:

Semantic-UI Dropdown Floating Type

Example 2: This example illustrates the Semantic-UI Dropdown Floating Type.




<!DOCTYPE html>
<html>
  
<head>
    <link href=
          rel="stylesheet" />
    <script src=
    </script>
    <script src=
    </script>
</head>
  
<body>
    <center>
        <div class="ui container">
            <h1 style="color:green;">
                GeeksforGeeks
            </h1>
            <h3>Semantic-UI Dropdown Floating Type</h3>
                <div class="ui button">Renew</div>
                <div class="ui floating dropdown icon button">
                    <div class="menu">
                        <div class="item">
                          <i class="archive icon"></i
                              Archive icon
                          </div>
                        <div class="item">
                          <i class="barcode icon"></i
                              Barcode icon
                          </div>
                        <div class="item">
                          <i class="code icon"></i
                              Code icon
                          </div>
                    </div>
                </div>
            </div>
        <script>
            $('.ui.dropdown').dropdown();
        </script>
    </center>
</body>
</html>

Output:

Semantic-UI Dropdown Floating Type

Reference: https://semantic-ui.com/modules/dropdown.html#floating


Article Tags :