3

I have below css classes and want to merge to one,

.classA {
  height: 500px;
  width: 800px;
}

.classB {
 height: 800px;
}

.classB > div {
 xxxx
 yyyy
}

.classA > div {
 xxxx
 yyyy
}

Here 'ClassA > div' and 'classB > div' have the same properties. So i need to make this as single class to apply to div element.

Please help.

4 Answers 4

4

Use a comma:

.classA > div, .classB > div {
 xxxx
 yyyy
}
Sign up to request clarification or add additional context in comments.

Comments

2

Use ,.

ClassA > div , classB > div { /* css rules */ }

Comments

1

Just do like this:

.classA > div, .classB > div {
    xxxx
    yyyy   
}

Comments

1
.classB > div, 
.classA > div 
{
   xxxx
   yyyy
}

Just use a comma

Comments

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.