Jump to content

Multiple Selectors For Elements


Eric_Ryk

Recommended Posts

I know you can chain selectors like div.someClass, but is CSS able to chain multiple classes?

 

That is,

 

.title.selected for any title class that is also of the class selected.

 

Is that the proper syntax or does that just select elements with either the title class or the selected class? Is there another syntax that does what I'm looking to do?

Link to comment
https://forums.phpfreaks.com/topic/127149-multiple-selectors-for-elements/
Share on other sites

Have a read on this page:

http://www.w3.org/TR/CSS2/selector.html#child-selectors

 

You can stack classes, if that's what you're asking: (separate class names with a space

<p class="title selected"></p>

 

Your css code will be applied in top down order.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.