Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
To select a class, you write the selector like this:
So now you have a way of selecting <p> elements that belong to a certain class. All you need to do is add the class attribute to any <p> elements you want to be green, and this rule will be applied. Give it a try: open your “lounge.css” file and add the p.greentea class selector to it.
body { font-family: sans-serif; } h1, h2 { color: gray; } h1 { border-bottom: 1px solid black; } p { color: maroon; } p.greentea { color: green; }