8, September 2008

How to extend a css class - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Design and Layout  >  Web Page Design  >  CSS (Moderator: Meth0d)
Topic: How to extend a css class
« previous next »
Pages: [1] Print

Author Topic: How to extend a css class  (Read 1096 times)
I wish I was an Oscar winner
**
Posts: 86
247 credits
Members referred : 0



« on: Sep 07, 2005, 08:45:17 PM »

I have a css class eg.

Code:
.class1 {
         font-weight: bold;
         color: #cc3333; 
         text-decoration: underline;
}



and I want to make a .class2 which will have all the proprties of the .class1 plus some others. Is there any way to extend the .class1 to create the class2 or I just have to copy the same code to both the classes?
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 credits
Members referred : 3



« Reply #1 on: Sep 07, 2005, 09:04:52 PM »

This is how you do that :

Code:
.class1, .class2 {
         font-weight: bold;
         color: #cc3333;
         text-decoration: underline;
}

.class2 {
       /*extra css for class 2*/
}

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
OMG!I am geek
**
Gender: Male
Posts: 58
127 credits
Members referred : 0



Red Matrix
« Reply #2 on: Mar 02, 2006, 04:19:09 PM »

It is also important to note that you can change your .class1 defaults in your .class2 by just reassigning the value.

eg:

Code:
.class1, .class2 { yadda1: one; yadda2: two; yadda3: three; }

.class2 { yadda1: zero; yadda4: four; yadda 5: five; }
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=108
Tags : css Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Design and Layout  >  Web Page Design  >  CSS (Moderator: Meth0d)
Topic: How to extend a css class
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Sep 08, 2008, 06:21:41 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.302
Total Topics: 7.479
Total Members: 3.907
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: phpprofit

20 Guests, 4 Users online :

6 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.