Skip to content

Instantly share code, notes, and snippets.

@kushalseth
Created August 20, 2020 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kushalseth/b0ba8d6aa21b28def616d393af41e9ad to your computer and use it in GitHub Desktop.
Save kushalseth/b0ba8d6aa21b28def616d393af41e9ad to your computer and use it in GitHub Desktop.
cssinheritence
<!DOCTYPE html>
<html>
<head>
<style>
div {
background-color: #ffff00; // yellow
}
p {
background-color: #ff0000; // red
}
</style>
</head>
<body>
<div>
<h2>I am h2 directly under div</h2>
<p data-test="001">This is para inside div, but not directly inside div</p>
</div>
<p class="myclass" data-test="001">I am paragraph directly inside the body and below a div</p>
</body>
</html>
@kushalseth
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment