Open In App

Semantic-UI Dropdown Image Content

Last Updated : 27 Feb, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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. Semantic-UI Dropdown offers us 11 types of dropdown and 3types of content Header, divider, and icon.  In this article, we will learn about Image Content.

Semantic-UI Dropdown Image Content is used to create a dropdown menu that contains an image.

Semantic-UI Dropdown Content Image Class:

  • image: This class is used to add an image to the specified dropdown menu.

Syntax:

<div class="ui dropdown button">
 <img class="...image" src="#">
     ...
   </div>
</div>

The below example illustrates the Semantic-UI Dropdown Image Content:

Example-1:

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic-UI Dropdown Image Content</title>
    <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 Image Content</h3>
            <div class="ui floating labeled icon dropdown button">
                <i class="add user icon"></i>
                <span class="text">Add a Company name</span>
                <div class="menu">
                    <div class="item">
                        <img class="ui avatar image"
                            src=
                        GeeksforGeeks Logo
                    </div>
                </div>
            </div>
        </div>
        <script>
            $('.ui.dropdown').dropdown();
        </script>
    </center>
</body>
  
</html>


Output:

Semantic-UI Dropdown Image Content

Semantic-UI Dropdown Image Content

Example-2:

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic-UI Dropdown Image Content</title>
    <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 Image Content</h3>
            <div class="ui floating labeled icon dropdown button">
                <i class="add user icon"></i>
                <span class="text">Add different logo of GFG</span>
                <div class="menu">
                    <div class="item">
                        <img class="ui avatar image"
                             src=
                        GeeksforGeeks Logo1
                    </div>
                    <div class="item">
                        <img class="ui avatar image"
                             src=
                        GeeksforGeeks Logo2
                    </div>
                    <div class="item">
                        <img class="ui avatar image" 
                             src=
                        GeeksforGeeks Logo3
                    </div>
                </div>
            </div>
        </div>
        <script>
            $('.ui.dropdown').dropdown();
        </script>
    </center>
</body>
  
</html>


Output:

Semantic-UI Dropdown Image Content

Semantic-UI Dropdown Image Content

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



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads