Jump to content

class inside class


Recommended Posts


<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>css</title><style>.a{color:red}.b{background-color:blue}.a .b{color:blue;background-color:red}.a > .b{color:yellow;background-color:green}</style></head><body><div class="a"><div><p class="b">Class a grandchild</p></div><p class="b">Class a child</p></div></body></html>
Link to comment
Share on other sites

The ">" selector selects an element that is an immediate child of another.

In your example, this would be selected:

<div class="flip3D>    <div class="back"></div></div>

But this wouldn't:

<div class="flip3D">    <div>        <div class="back"></div>    </div></div>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...