0

What I'm trying to do is refer a css class in another css class:

.customClass1{
     //some styles
}

.customClass2{
     //some styles
}

.customClass3{
     use customClass1;
     use customClass2;
}

Is this even possible?

4
  • 1
    Why don't add those two class to the element ? ..... or in the CSS .customClass1, .customClass3 { Commented Feb 24, 2015 at 15:15
  • 1
    Not using vanilla CSS. You can use mixins with LESS.js however. Commented Feb 24, 2015 at 15:15
  • 1
    In purse CSS, no. But something like Sass's @extend will do what you want. Commented Feb 24, 2015 at 15:17
  • 1
    basically why would you want to? whichever attribute you're using the css class, you combine the classes. <a href="#" class="customClass1 customClass2 customClass3">your styled link</a> Commented Feb 24, 2015 at 15:17

1 Answer 1

1

You should use a CSS pre-processor like LESS, then you can use Mixins LESS Mixins

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.