0

I have div where i have css class orcitMultiselectTreeviewHeight and inside i have another div element that is using orcitMultiselectTreeview and inside i have another div that is using class orcitMultiselectTreeviewTagList. So i want to target styling for orcitMultiselectTreeviewTagList. how can i achieve this task ?

main.css

.orcitMultiselectTreeview.orcitMultiselectTreeview .orcitMultiselectTreeviewTagList { 
    max-height: 5em;
    overflow: scroll;
    }
1
  • 1
    Can you please post a snippet of your HTML, it is hard to be sure the exact structure that you are using Commented Jan 19, 2016 at 16:53

3 Answers 3

1

If you are targeting an element with 2 classes and want to specify both classes there is no space between the selectors. If it is a child then there is a space. Direct child you use >

<div class="class1 class2">
   <div class="class3">
       <div class="class4">

       </div>
   </div>
</div>

CSS-

.class1.class2 { //selects the base div }
.class1 .class4 { //selects class4 div only }
.class1 > .class4 { //selects no div as class4 is not a child of class1 }
.class1 .class3 .class4 { //selects class4 }
.class1.class2 .class3 > .class4 { //selects class4 as a direct child of class 3 }
Sign up to request clarification or add additional context in comments.

Comments

1

I'm assuming you have a typo in your list of selectors, and that it should read: .orcitMultiselectTreeviewHeight .orcitMultiselectTreeview .orcitMultiselectTreeviewTagList

Also, notice the space between each selector, denoting them as children of each.

3 Comments

another problem when input is 5em scroll should appear that is not happening
@aftab Can you share the relevant HTML and CSS?
I think this should be the accepted answer to the question. +1.
0

So i want to target styling for .orcitMultiselectTreeviewTagList. how can I achieve this task ?

If you are using .orcitMultiselectTreeviewTagList in many places throughout the document and you want to target this instance alone, the correct selector is:

.orcitMultiselectTreeviewHeight .orcitMultiselectTreeview .orcitMultiselectTreeviewTagList {

[STYLES HERE]

}

2 Comments

but i just want to make change on this specific instance we are using this element alot of places
Sorry, I misunderstood your question. I have edited the post above to give the correct answer.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.