initial keyword - HTML CSS CSS

HTML CSS examples for CSS:Introduction

Description

The initial keyword sets a CSS property to its default value.

JavaScript syntax

object.style.property="initial"

The following code shows how to Set the text color of the <div> element to red, but keep the initial color for <h1> elements:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
div {<!--   w  ww  .  j  a v  a 2s  .c o  m-->
    color: red;
    border: 1px solid blue;
}

h1  {
    color: initial;
}
</style>
</head>
<body>

<div>
  <h1>Initial</h1>
</div>



</body>
</html>

Related Tutorials