CSS initial Keyword

CSS initial keyword applies the initial value or default value of a property to an element.

CSS initial keyword applied to any CSS property. The initial keyword can be used to restore all CSS properties to their initial state.

Usages

The following table outline the usages and version history of this keyword.

Applies to: all elements
Version: CSS3
JavaScript Syntax: object.style.property = "initial"

Syntax

Here is a syntax for the CSS initial keyword

property: initial;

Example

<!DOCTYPE html>
<html>
<head>
  <title>CSS initial Keyword</title>
  <style>
    p {
      color: blue;
      font-size: 35px;
    }
    span {
      color: initial;
      font-size: initial;
    }
  </style>
</head>
<body>
  <p>
    This is a paragraph text <span>This text size and color are initial</span> This is a paragraph text
  </p>
</body>
</html>

Run it...   »

Browser Compatibility

  • Google Chrome 1+
  • Mozilla Firefox 19+
  • Internet Explorer 12+
  • Opera 15+
  • Safari 1.2+

Note: Here details of browser compatibility with version number may be this is bug and not supported. But recommended to always use latest Web browser.