Here is the code
body {
color: purple;
}
p {
color: blue;
}
<body>
<p>
<h1>Hello</h1>
</p>
<h1>Hello</h1>
</body>
Now problem here is that h1 does not inherit the color of element p which is its nearest parent.
I read that if color is not given, then its default value is inherit. So, first h1 should be blue. So, what is happening here ?