InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

CSS

    CSS selectors

    • CSS selectors

    CSS properties

    • CSS properties

    CSS cookbooks

    • !important annotation
    • Align div in center horizontally
    • Align div in center vertically
    • Align multiple divs horizontally
    • Align text in center horizontally
    • CSS - drop cap effect
    • CSS - enlarge image on hover
    • CSS - round toggle switch using checkbox and label
    • CSS automatic table row numbering
    • CSS circle and oval
    • CSS clearfix - clear float automatically using ::after
    • CSS counters
    • CSS nested counters
    • CSS3 gradients
    • Create CSS triangles
    • First letter capital and bigger
    • How to display text on image using css
    • Install sass on Mac or Linux using ruby gem
    • Place a div in bottom right corner of browser
    • Test site css, javascript, html in old IEs
    • csslint
    • inherit value
    • initial value
    • inline-block and baseline alignment
    • margin collapsing
    • node-sass quick start tutorial on Linux and Mac
    • unset value
    • web typography
     
    • Home
    • > Tutorials
    • > CSS

    CSS unset value examples

    on Mar 7, 2016

    If CSS property value is unset, then if it is an inherited property, this is treated as inherit, and if it is not, this is treated as initial. It is like erasing all declarations. Also note that it is not supported in IE.

    Here is sample code using css unset

    <style type="text/css">
    .box {color:green;}
    h2 {color: blue;}
    .box > h2 {color:unset;}
    </style>
    
    <h2>h2 text</h2>
    <div class="box">
      <h2>h2 text with color unset (it will use inherit as color is inherited property)</h2>
    </div>
    refresh done
    try it online

    Specification and Browser compatibility

    SpecificationStatusCategories
    CSS unset valueW3C Candidate RecommendationCSS
    Desktop
    ChromeFirefoxIEEdgeSafariOpera
    Yes 41+ Yes 27+ NoYes 13+ Yes 9.1+ Yes 28+
    Mobile
    Android ChromeAndroid FirefoxiOS SafariIE MobileOpera Mobile
    Yes 47+ Yes 44+ Yes 9.3+ NoNo
    source: caniuse.com

    Related links

    • CSS initial value examples
    • CSS inherit value examples

    Suggested posts:

    1. CSS initial value examples
    2. WordPress – add content filter after shortcode execution
    3. CSS inherit value examples
    4. CSS color values
    5. CSS text-indent – indent text in a block
    6. CSS outline – create outline around an element
    7. CSS color
    8. Chrome – disable notifications from a site accepted earlier
    Share this article: share on facebook share on linkedin tweet this submit to reddit
    Posted in Tutorials | Tagged CSS, CSS cookbook, Tutorials
    • Browse content
    • Article Topics
    • Article archives
    • Contact Us
    Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

    Copyright © 2025 InfoHeap.

    Powered by WordPress