471,603 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,603 software developers and data experts.

Extending a style class

Is it possible to extend a style class?
for example i have to classes
.common {
.commonFont {
I need the class commonFont also to have the properties of the class common.
How can this be done?
Oct 16 '07 #1
1 2377
7,435 Expert 4TB
Yes and no. It's possible for an element to inherit styles from parent elements. For example, if you have a <h1 class="mystyles"> and <h2> inside a <div>, you can apply all the styles of <div> to the <h1> with:
div h1{
your styles
or better yet:
div .mystyles{

Another way is with "selectors".
Oct 16 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Michele Simionato | last post: by
4 posts views Thread by henrikpierrou | last post: by
4 posts views Thread by Matt | last post: by
6 posts views Thread by Don | last post: by
5 posts views Thread by vbgunz | last post: by
reply views Thread by =?Utf-8?B?Um9iZXJ0IFNtaXRo?= | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.