Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Semantic-UI Rail Dividing Type

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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. It uses a class to add CSS to the elements.

Rails are an excellent way to display additional content to the user, usually, they are used to display ads. They are placed either to the left or right of the main viewport with a default width of 300px. For the semantic rails to work, the main container should have a width between 600 pixels to 800 pixels. The main viewport and the rails can be divided using the divided class.

Semantic-UI Rail Dividing Type Classes:

  • dividing: Creates a division between the rail and the main viewport.

Syntax:

<div class="ui segment">
    <div class="ui rail dividing">
        <div class="ui segment">
            ...
        </div>
    </div>
    ...
</div>
...

Example 1: In the below example, we have divided the rails and the main viewport.

HTML




<!DOCTYPE html>
<html>
    <head>
        <title>Semantic UI Rail Dividing Type</title>
        <link href=
              rel="stylesheet" />
        <script src=
            integrity=
 "sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" 
                crossorigin="anonymous">
        </script>
        <script src=
        </script>
    </head>
    <body>
        <div class="ui container">
            <h2 class="ui green header">GeeksforGeeks</h2>
            <h4>Semantic UI Rail Dividing Type</h4>
            <hr>
            <br/>
            <div class="ui segment" 
                 style="margin: auto; width:500px;">
                <div class="ui left rail dividing">
                    <div class="ui tiny segment">
                      This is a tiny rail divided from
                      the main viewport.
                    </div>
                </div>
                <div class="ui right rail dividing">
                    <div class="ui tiny segment">
                      This is a tiny rail divided from
                      the main viewport.
                    </div>
                </div>
                <p>Main Viewport</p>
                <p>Main Viewport</p>
            </div>
        </div>
    </body>
</html>


Output:

Semantic-UI Rail Dividing Type

Semantic-UI Rail Dividing Type

Example 2: In the below example, we have illustrated the difference between a dividing rail and a normal rail.

HTML




<!DOCTYPE html>
<html>
    <head>
        <title>Semantic UI Rail Dividing Type</title>
        <link href=
              rel="stylesheet" />
        <script src=
            integrity=
"sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
                crossorigin="anonymous">
        </script>
        <script src=
        </script>
    </head>
    <body>
        <div class="ui container">
            <h2 class="ui green header">GeeksforGeeks</h2>
            <h4>Semantic UI Rail Dividing Type</h4>
            <hr>
            <br/>
            <div class="ui segment" style="margin: auto; width:500px;">
                <div class="ui left rail dividing">
                    <div class="ui tiny segment">
                      This is a tiny rail divided
                      from the main viewport.
                    </div>
                </div>
                <div class="ui right rail">
                    <div class="ui tiny segment">
                        This is a tiny normal rail.
                    </div>
                </div>
                <p>Main Viewport</p>
                <p>Main Viewport</p>
  
            </div>
        </div>
    </body>
</html>


Output:

Semantic-UI Rail Dividing Type

Semantic-UI Rail Dividing Type

Reference: https://semantic-ui.com/elements/rail.html


My Personal Notes arrow_drop_up
Last Updated : 16 Mar, 2022
Like Article
Save Article
Similar Reads
Related Tutorials