Hi, In this case: <div class="class1 class2"> <p>My paragraph></p> </div> HTML: How can I style the paragraph element? Will this work? .class1 p{ style } ?
Did you try it and see? : ) But if your question was, to only give this style to paragaphs who are in boxes with BOTH classes on it (meaning you don't want the style if the box around it only has one or the other classes) you can do this: .class1.class2 p {styles for p's whose parents/ancestors have BOTH classes;} See, no space as descendant selector between the two classes.
What you posted above .class1 p {styles} will work for any box with that style on it. .class2 p {styles} will work for any box with that style. So you don't need to list BOTH styles to get the p styled UNLESS you only want p's whose parents have BOTH to get styled. I want to make sure I didn't confuse you. <div class="class1 class2"><p>stuff</p></div> this p can be styled with any of the code above but you can also have this in your HTML <div class="class1"> and a <p> inside it</div> If you didn't want this p to get the same styles as the p above whose parent has both classes, then you'd need the .class1.class2 p {styles} for the first p and something else (like .class1 p {styles}) for the other p but if it's ok for the p in teh first HTML AND the p in the second HTML examples to both have the same styles, then .class1 p {styles} is fine and what you want.