0

I want to target the "order_bar_active" class but I'm not getting the right hierarchy.

<div class="order_bar">
<table class="order_bar">
<tbody>
<tr>
<td id="adress_data_bar" class="order_bar_active">
</td></tr></tbody></table></div>

Edit: The class="order_bar_active" is not unique, so I need to define it using the unique id="adress_data_bar".

EDIT #2: The solution for my specific problem is:

table.order_bar #adress_data_bar.order_bar_active {
}
3
  • simply #adress_data_bar or .order_bar .order_bar_active {... or div.order_bar .order_bar_active {... or table.order_bar .order_bar_active {...
    – Abhitalks
    Jun 4, 2014 at 9:18
  • so what's the problem with just #adress_data_bar {... ??
    – Abhitalks
    Jun 4, 2014 at 9:37
  • your edit#2 is unnecessary. id is supposed to be unique and hence no need for that selector. just #adress_data_bar {... will suffice.
    – Abhitalks
    Jun 4, 2014 at 9:47

1 Answer 1

3

In your example the order_bar_active class is the only one of it's kind so you simply need

.order_bar_active {
  your rules
}

Further to your edit that order_bar_active is not unique, you can append the class name to the unique ID like so:

#address_data_bar.order_bar_active {
  your rules
}
1
  • Unfortunately #address_data_bar.order_bar_active doesn't respond, that's why I came to the conclussion that I have to add more hierarchic informations, which I am struggeling to implement due to complexity of the hierarchy. EDIT: Added the solution which came through your help! thank you. Jun 4, 2014 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.