Semantic-UI | Segment

A semantic UI open-source framework provides a segment or portion on a webpage that is used to create a group of related content. It is very similar to bootstrap usage and has different elements to make your website more amazing using jQuery and CSS for interfaces. For styling of elements, it uses classes.

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic UI</title>
    <link href=
        rel="stylesheet" />
</head>
  
<body>
    <div style="margin-top: 100px" 
        class="ui container">
  
        <h2>Segment</h2>
        <br>
        <div class="ui segment">
            <center>
                <h3>Welcome to geeksforgeeks.</h3>
                <p>Learn anything you want</p>
                <p>
                    Get tutorial of anything 
                    related to computer science.
                </p>
                <p>Courses on programming</p>
                <p>Solve programming problems.</p>
                <p>Help other by writing articles.</p>
            </center>
        </div>
    </div>
    <script src=
        integrity=
"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
        crossorigin="anonymous">
    </script>
      
    <script src=
    </script>
</body>
  
</html>

chevron_right


Output:

Example: The example shows placeholder segment.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic UI</title>
    <link href=
        rel="stylesheet" />
</head>
  
<body>
    <div style="margin-top: 100px" 
        class="ui container">
          
        <h2>Placeholder segment</h2>
        <br>
        <div class="ui placeholder segment">
            <div class="ui icon header">
                <i class="file image icon"></i>
                Upload Photo
            </div>
            <div class="ui primary button">
                Add Photo
            </div>
        </div>
    </div>
    <script src=
        integrity=
"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
        crossorigin="anonymous">
    </script>
      
    <script src=
    </script>
</body>
  
</html>

chevron_right


Output:



Example: This example shows raised segment that gives a top view on the page.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic UI</title>
    <link href=
        rel="stylesheet" />
</head>
  
<body>
    <div style="margin-top: 100px" 
        class="ui container">
          
        <h2>Raised segment</h2>
        <br>
        <div class="ui raised segment">
            <h2>
                Hello, Welcome to 
                geeksforgeeks
            </h2>
        </div>
    </div>
    <script src=
        integrity=
"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
        crossorigin="anonymous">
    </script>
      
    <script src=
    </script>
</body>
  
</html>

chevron_right


Output:

Example: The following example shows stacked segment which looks multiple pages.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic UI</title>
    <link href=
        rel="stylesheet" />
</head>
  
<body>
    <div style="margin-top: 100px" 
        class="ui container">
          
        <h2>Stacked segment</h2>
        <br>
        <div class="ui tall stacked segment">
  
            <h2>
                Hello, Welcome to 
                geeksforgeeks
            </h2>
        </div>
    </div>
    <script src=
        integrity=
"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
        crossorigin="anonymous">
    </script>
      
    <script src=
    </script>
</body>
  
</html>

chevron_right


Output:

Example: The following example shows piled segment like pages.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic UI</title>
    <link href=
        rel="stylesheet" />
</head>
  
<body>
    <div style="margin-top: 100px" 
        class="ui container">
          
        <h2>Piled segment</h2>
        <br>
        <div class="ui piled segment">
            <h2>
                Hello, Welcome to 
                geeksforgeeks
            </h2>
        </div>
    </div>
    <script src=
        integrity=
"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
        crossorigin="anonymous">
    </script>
      
    <script src=
    </script>
</body>
  
</html>

chevron_right


Output:

Example: The following example shows vertical segment.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic UI</title>
    <link href=
        rel="stylesheet" />
</head>
  
<body>
    <div style="margin-top: 100px" 
        class="ui container">
          
        <h2>Vertical segment</h2>
        <br>
        <div class="ui vertical segment">
            <p>Data Structure</p>
        </div>
        <div class="ui vertical segment">
            <p>Web Programming</p>
        </div>
        <div class="ui vertical segment">
            <p>Competative Programming</p>
        </div>
    </div>
    <script src=
        integrity=
"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" 
        crossorigin="anonymous">
    </script>
      
    <script src=
    </script>
</body>
  
</html>

chevron_right


Output:



Example: The following example shows group segment.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic UI</title>
    <link href=
        rel="stylesheet" />
</head>
  
<body>
    <div style="margin-top: 100px" 
        class="ui container">
          
        <h2>Group segment</h2>
        <br>
        <div class="ui segments">
            <div class="ui segment">
                <p>Data Structure</p>
            </div>
            <div class="ui green segment">
                <p>Web Programming</p>
            </div>
            <div class="ui blue segment">
                <p>Competative Programming</p>
            </div>
        </div>
    </div>
    <script src=
        integrity=
"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
        crossorigin="anonymous">
    </script>
      
    <script src=
    </script>
</body>
  
</html>

chevron_right


Output:

Example: The following example shows nested segment.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic UI</title>
    <link href=
        rel="stylesheet" />
</head>
  
<body>
    <div style="margin-top: 100px" 
        class="ui container">
          
        <h2>Nested segment</h2>
        <br>
        <div class="ui segment">
            <p>Web Programming</p>
            <div class="ui segments">
                <div class="ui segment">
                    <p>Django</p>
                </div>
                <div class="ui segment">
                    <p>NodeJS</p>
                </div>
            </div>
        </div>
  
        <div class="ui segment">
            <p>Data Structure</p>
            <div class="ui segments">
                <div class="ui segment">
                    <p>Array</p>
                </div>
                <div class="ui segment">
                    <p>Linklist</p>
                </div>
                <div class="ui segment">
                    <p>Tree</p>
                </div>
            </div>
        </div>
    </div>
    <script src=
        integrity=
"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
        crossorigin="anonymous">
    </script>
      
    <script src=
    </script>
</body>
  
</html>

chevron_right


Output:

Example: The following example shows horizontal segment.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic UI</title>
    <link href=
        rel="stylesheet" />
</head>
  
<body>
    <div style="margin-top: 100px" 
        class="ui container">
          
        <h2>Horizonal segment</h2>
        <br>
  
        <div class="ui horizontal segments">
            <div class="ui segment">
                <p>Array</p>
            </div>
            <div class="ui segment">
                <p>Linklist</p>
            </div>
            <div class="ui segment">
                <p>Tree</p>
            </div>
        </div>
  
    </div>
    <script src=
        integrity=
"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
        crossorigin="anonymous">
    </script>
      
    <script src=
    </script>
</body>
  
</html>

chevron_right


Output:

Example: The following example shows loading segment.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic UI</title>
    <link href=
        rel="stylesheet" />
</head>
  
<body>
    <div style="margin-top: 100px" 
        class="ui container">
          
        <h2>Loading segment</h2>
        <br>
        <div class="ui loading segment">
            <p></p>
            <p></p>
        </div>
    </div>
    <script src=
        integrity=
"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
        crossorigin="anonymous">
    </script>
      
    <script src=
    </script>
</body>
  
</html>

chevron_right


Output:

Example: The following example shows inverted segment.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic UI</title>
    <link href=
        rel="stylesheet" />
</head>
  
<body>
    <div style="margin-top: 100px" 
            class="ui container">
        <h2>Inverted segment</h2>
        <br>
  
        <div class="ui inverted segment">
            <h2>
                Hello, welcome to 
                geeksforgeeks.
            </h2>
        </div>
    </div>
    <script src=
        integrity=
"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
        crossorigin="anonymous">
    </script>
      
    <script src=
    </script>
</body>
  
</html>

chevron_right


Output:

Example: The following example shows circular segment.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic UI</title>
    <link href=
        rel="stylesheet" />
</head>
  
<body>
    <div style="margin-top: 100px" 
            class="ui container">
        <h2>Circular segment</h2>
        <br>
  
        <div class="ui circular segment">
            <h2>
                Hello, welcome to 
                geeksforgeeks.
            </h2>
        </div>
    </div>
    <script src=
        integrity=
"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
        crossorigin="anonymous">
    </script>
      
    <script src=
    </script>
</body>
  
</html>

chevron_right


Output:




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



Improved By : Akanksha_Rai

Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.