Skip to content
Related Articles
Open in App
Not now

Related Articles

How to align item set to its default value in CSS ?

Improve Article
Save Article
Like Article
  • Last Updated : 03 Jun, 2021
Improve Article
Save Article
Like Article

In this article, we will learn how to align an item set to its default value in CSS.

Approach: The align-items property is used to set the alignment of items inside the flexible container or in the given window. It takes value. The initial value is used to set this property value to default value. So we set align-items property value to initial.

Syntax:

align-items : initial;

Example :

HTML




<!DOCTYPE html>
<html>
  
<head>
    <style>
        .gfg {
            font-size: 30px;
            width: 320px;
            height: 200px;
            border: 2px solid black;
            display: flex-end;
            align-items: initial;
        }
    </style>
</head>
  
<body>
    <center>
        <h1 style="color:green;">GeeksforGeeks</h1>
  
        <div class="gfg">
            <div style="background-color:green;">
                Green
            </div>
            <div style="background-color:Yellow;">
                Yellow
            </div>
        </div>
    </center>
</body>
  
</html>

Output:

My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!