0

I have a problem, I need to use one property of a css class in other css class.

.class_a {margin:10px; width: 360px; float: left; color:#ffffff; ...etc...}

.class_b { .class_a of margin }

use in class_b only margin of class_a

thanks!

5
  • 2
    Not possible in pure CSS. CSS preprocessors like LESS can do this. Commented Oct 29, 2012 at 20:28
  • How come you want to do this? Commented Oct 29, 2012 at 20:29
  • possible duplicate of Is it possible make a CSS rule that combines two or more other CSS rules? Commented Oct 29, 2012 at 20:30
  • 1
    Can you move the declaration of the margin to a new class, then add that class to the HTML elements which receive class_a? Commented Oct 29, 2012 at 20:31
  • I want to use jquery ui themes, but just colors and bg-s. Commented Oct 29, 2012 at 20:34

2 Answers 2

1

You cannot do this using traditional CSS, you need to use dynamic approach like LESS or SASS

LESS Reference

SASS Reference

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

Comments

1

Your quickest option here might be to find the styles you want with firebug or chrome developer tools and add them to your stylesheet.

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.