div p {
background-color: yellow;
}
div > p {
background-color: yellow;
}
div + p {
background-color: yellow;
}
div ~ p {
background-color: yellow;
}
____ {
color: red;
}
</style>
<body>
<div>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</div>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
<style>
div p {
color: red;
}
</style>
<body>
<div>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</div>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
10 videos|41 docs|23 tests
|
|
Explore Courses for Class 6 exam
|