Skip to content
Related Articles

Related Articles

Improve Article

Semantic-UI | Segment

  • Last Updated : 13 Sep, 2021
Geek Week

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:




<!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>

Output:

Example: The example shows placeholder segment.




<!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>

Output:



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




<!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>

Output:

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




<!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>

Output:

Example: The following example shows piled segment like pages.




<!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>

Output:

Example: The following example shows vertical segment.




<!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>

Output:



Example: The following example shows group segment.




<!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>

Output:

Example: The following example shows nested segment.




<!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>

Output:

Example: The following example shows horizontal segment.




<!DOCTYPE html>
<html>
  
<head>
    <title>Semantic UI</title>
    <link href=
        rel="stylesheet" />
</head>
  
<body>
    <div style="margin-top: 100px" 
        class="ui container">
          
        <h2>Horizontal 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>

Output:

Example: The following example shows loading segment.




<!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>

Output:

Example: The following example shows inverted segment.




<!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>

Output:

Example: The following example shows circular segment.




<!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>

Output:




My Personal Notes arrow_drop_up
Recommended Articles
Page :