Open In App

Semantic-UI Varying Grids

Semantic UI is the open-source framework that used CSS and jQuery to make our websites look beautiful and responsive. It has predefined classes like bootstrap for use to make our website more interactive. It has some pre-built semantic components and we can use these components to create a responsive website.

Semantic-UI Grid is used to harmonize the negative space in our webpage layout. The Varying Grid facilitates the alignment of the content either horizontal or vertical, along with styling with different colors variations in the grid. It has 5 types of Varying Grids, which are Nesting Grids, Colored, Automatic Column Count, Centering Content, and Significant Word Order.



In this article, we will discuss all the varying grid types in Semantic-UI, along with their implementations.

Semantic-UI Varying Grid:



Syntax:

<div class="Varying-Grid-Types">
   ...
</div>

Example 1: The following example demonstrates the Semantic-UI Varying Grids by specifying the nested colored grids.




<!DOCTYPE html>
<html>
  
<head>
    <link rel="stylesheet" href=
</head>
  
<body>
    <div class="ui container center aligned">
        <h1 class="ui green header">
            GeeksforGeeks
        </h1>
        <h3>
            Semantic-UI Varying Grids
        </h3>
        <br>
        <div class="ui two column grid">
            <div class="column">
                <div class="ui four column grid">
                    <div class="green column"
                        GFG Nested 
                    </div>
                    <div class="red column"
                        GFG Nested 
                    </div>
                    <div class="blue column"
                        GFG Nested 
                    </div>
                    <div class="orange column">
                        GFG Nested 
                     </div>
                </div>
            </div>
            <div class="pink column">
                GeeksforGeeks 
            </div>
            <div class="grey column">
                GeeksforGeeks 
            </div>
            <div class="column">
                <div class="ui grid">
                    <div class="green four wide column"
                        GFG Nested 
                    </div>
                    <div class="blue three wide column"
                        GFG Nested 
                    </div>
                    <div class="red nine wide column"
                        GFG Nested 
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

Output:

Semantic-UI Varying Grids

Example 2: The following code demonstrates the Semantic-UI Varying Grid Significant Word Order using left floated, right floated, left-aligned, and right-aligned classes.




<!DOCTYPE html>
<html>
      
<head>
<title>Semantic-UI Varying Grid</title>
      
<link href=
rel="stylesheet"/>
</head>
  
<body>
<div class="ui container center aligned">
    <h2 class="ui green header"> GeeksforGeeks </h2>
    <h3> Semantic-UI Varying Grid Significant Word Order </h3>
</div> <br>
      
<div class="ui grid">
    <div class="left floated right aligned seven wide column">
    <div class="ui segment">
        GFG Left floated Right aligned
    </div>
    </div>
      
    <div class="right floated left aligned seven wide column">
    <div class="ui segment">
        GFG Right floated left aligned
    </div>
    </div>
  
    <div class="right floated seven wide column">
    <div class="ui segment">
        GeeksforGeeks Right floated
    </div>
    </div>
</div>
</body>
  
</html>

Output:

Semantic-UI Varying Grid

Reference: https://semantic-ui.com/collections/grid.html#nesting-grids


Article Tags :