Semantic-UI | Segment - GeeksforGeeks

13 Sep, 2021
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="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"        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="https://code.jquery.com/jquery-3.1.1.min.js"        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="        crossorigin="anonymous">    </script>          <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js">    </script></body>  </html>
Output:
Example: The example shows placeholder segment.
<!DOCTYPE html><html>  <head>    <title>Semantic UI</title>    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"        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="https://code.jquery.com/jquery-3.1.1.min.js"        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="        crossorigin="anonymous">    </script>          <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js">    </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="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"        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="https://code.jquery.com/jquery-3.1.1.min.js"        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="        crossorigin="anonymous">    </script>          <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js">    </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="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"        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="https://code.jquery.com/jquery-3.1.1.min.js"        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="        crossorigin="anonymous">    </script>          <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js">    </script></body>  </html>
Output:
Example: The following example shows piled segment like pages.
<!DOCTYPE html><html>  <head>    <title>Semantic UI</title>    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"        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="https://code.jquery.com/jquery-3.1.1.min.js"        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="        crossorigin="anonymous">    </script>          <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js">    </script></body>  </html>
Output:
Example: The following example shows vertical segment.
<!DOCTYPE html><html>  <head>    <title>Semantic UI</title>    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"        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="https://code.jquery.com/jquery-3.1.1.min.js"        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="         crossorigin="anonymous">    </script>          <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js">    </script></body>  </html>
Output:
Example: The following example shows group segment.
<!DOCTYPE html><html>  <head>    <title>Semantic UI</title>    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"        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="https://code.jquery.com/jquery-3.1.1.min.js"        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="        crossorigin="anonymous">    </script>          <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js">    </script></body>  </html>
Output:
Example: The following example shows nested segment.
<!DOCTYPE html><html>  <head>    <title>Semantic UI</title>    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"        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="https://code.jquery.com/jquery-3.1.1.min.js"        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="        crossorigin="anonymous">    </script>          <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js">    </script></body>  </html>
Output:
Example: The following example shows horizontal segment.
<!DOCTYPE html><html>  <head>    <title>Semantic UI</title>    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"        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="https://code.jquery.com/jquery-3.1.1.min.js"        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="        crossorigin="anonymous">    </script>          <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js">    </script></body>  </html>
Output:
Example: The following example shows loading segment.
<!DOCTYPE html><html>  <head>    <title>Semantic UI</title>    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"        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="https://code.jquery.com/jquery-3.1.1.min.js"        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="        crossorigin="anonymous">    </script>          <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js">    </script></body>  </html>
Output:
Example: The following example shows inverted segment.
<!DOCTYPE html><html>  <head>    <title>Semantic UI</title>    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"        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="https://code.jquery.com/jquery-3.1.1.min.js"        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="        crossorigin="anonymous">    </script>          <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js">    </script></body>  </html>
Output:
Example: The following example shows circular segment.
<!DOCTYPE html><html>  <head>    <title>Semantic UI</title>    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"        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="https://code.jquery.com/jquery-3.1.1.min.js"        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="        crossorigin="anonymous">    </script>          <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js">    </script></body>  </html>
Output:
Akanksha_Rai
sagar0719kumar
Semantic-UI
CSS
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to insert spaces/tabs in text using HTML/CSS?
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to update Node.js and NPM to next version ?
How to create footer to stay at the bottom of a Web page?
How to apply style to parent if it has child with CSS?
Remove elements from a JavaScript Array
Installation of Node.js on Linux
Convert a string to an integer in JavaScript
How to fetch data from an API in ReactJS ?
How to insert spaces/tabs in text using HTML/CSS?