How to inherit the contents of an existing class? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:14:40
Original
927 people have browsed it




In this case, b has background-color and colo at the same time...
Me I hope to use b to inherit all the attributes of a, and modify or supplement other attributes. The premise is that a is not changed, and b does not exist when a is declared, so this cannot be solved.

You can write three styles, .a {color:red;//a unique style} .b {color:blue;//bunique style} .a,.b {background-color :red;//a b public style}
I want a to be the default style and b to be a selected style, so a cannot be declared together with b, and there cannot be a common style.



adasd


Yours, Is this what you mean?



adasd


Yours, Is this what you mean?
That’s it, that’s how I use it now, but I hope that I can use the function of a b with only b, but I don’t want to write the code twice

There seems to be no solution? If you can’t help it, just post it and share the hard work with everyone

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template