CSS | unset keyword

The CSS unset keyword is an inbuilt keyword in CSS. The CSS unset keyword is an inbuilt keyword in CSS which has been used to unset the cascading style to its parent element. It behaves like the inherit keyword in the first case, and like the initial keyword in the second case

Syntax:

property: unset;

Below example illustrates the unset keyword in CSS:
Example:



filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>CSS unset keyword</title>
        <style>
  
            /* Color for all the child in parent element */
            div {
                color: green;
            }
              
            /* Specific b and p element color */
            b, p {
                color: black;
            }
              
            /* Performing revert for child */
            .rvt {
                color: unset;
            }
        </style>
    </head>
    <body>
           
        <!-- Parent elements -->
        <div class="container">
    
            <!-- Child elements -->
            <h1>GeeksforGeeks</h1>
            <b>A Computer Science Portal for Geeks</b>
            <p>I'm not assign in unset</p>
            <p class="rvt">I'm assign in unset</p>
        </div>
    </body>
</html>

chevron_right


Output:

Supported Browsers: The browsers supported by CSS unset keyword are listed below:

  • Mozila Firefox
  • Internet Explorer/ Microsoft Edge



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.