Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 CSS class references
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 16 April 2002 :  06:35:07  Show Profile  Visit Kat's Homepage
Does anyone know if it is possible to refer to another class from within a new class in CSS?

example:

<style...>

.dummyclass {color: red;}
p {somehow tell this to use the dummyclass}

I can't get it to work. Does anyone have any clues?

KatsKorner

Installation Help | http://ls3k.com/snitz/mods.asp" target="_blank">Snitz Mods | Forum Hosting

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 16 April 2002 :  07:24:32  Show Profile
The only thing I know to do if you want the same attributes for both is to put them on the same line:

.dummyclass, p {color:red}

Nikkol
Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 16 April 2002 :  07:31:12  Show Profile  Visit Kat's Homepage
Thanks but I don't want to do that because I don't want it to apply everywhere - ie. not for every paragraph.

I don't think it is supported.

KatsKorner

Installation Help | http://ls3k.com/snitz/mods.asp" target="_blank">Snitz Mods | Forum Hosting
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 16 April 2002 :  07:33:36  Show Profile  Visit Gremlin's Homepage
Nikkol's way should work, Not sure theres any other way to do it. The whole premise behind CSS is that it's 'cascading' so many attributes are inherited between classes.

Heres a useful reference on CSS Structures that might help a little.

http://www.htmlhelp.com/reference/css/structure.html

www.daoc-halo.com
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 16 April 2002 :  07:46:21  Show Profile  Send ruirib a Yahoo! Message
It may not sound like the most efficient way to do it, but maybe you can define a class for every major different paragraph type you want, and then apply the class to the paragraph.
Doesn't look like CSS supports inheritance in an object-oriented way, like you seem to want...

-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 16 April 2002 :  07:57:17  Show Profile  Visit Kat's Homepage
Yeah ruirib you are right - t doesn't support what I am looking to do. There are other ways around it.

Cheers for the reference. I found that one already but it helps to post them!!

KatsKorner

Installation Help | http://ls3k.com/snitz/mods.asp" target="_blank">Snitz Mods | Forum Hosting
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 16 April 2002 :  08:13:19  Show Profile  Visit Gremlin's Homepage
If you use ASP to generate the CSS file you can expand the possibilties a little and could 'fudge' what you want probably by setting some strings up and then conditionally generate the classes with the info you want in them.

www.daoc-halo.com
Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 16 April 2002 :  09:03:23  Show Profile  Visit Kat's Homepage
Thanks Gremlin but that won't help with what I am trying to do. This all works within a toolset and is largley xsl/xml driven.

I think we have figured out how to do what we need now. The OO approach certainly won't help that is for sure!

KatsKorner

Installation Help | http://ls3k.com/snitz/mods.asp" target="_blank">Snitz Mods | Forum Hosting
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 16 April 2002 :  09:45:33  Show Profile  Visit Nathan's Homepage
I'm not quite sure exactly what you are asking, but if you want to make all <p> elements inside a .dummyclass red, then use this.

.dummyclass p {color: red;}

Nathan Bales
Snitz Exchange | Do's and Dont's
Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 16 April 2002 :  10:43:29  Show Profile  Visit Kat's Homepage
No that isn't what I wanted Nathan but thanks anyway.

What I was trying to do was declare a class in a stylesheet and tehn refer to that class in another class. It isn't possible to do this.

KatsKorner

Installation Help | http://ls3k.com/snitz/mods.asp" target="_blank">Snitz Mods | Forum Hosting
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 16 April 2002 :  19:00:32  Show Profile  Visit Nathan's Homepage
I am not aware of any way to do this.

I can however see a use for doing it if you are both using an included style sheet and a page spacific style sheet in the <head> element. . . .

Nathan Bales
Snitz Exchange | Do's and Dont's
Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 17 April 2002 :  04:27:12  Show Profile  Visit Kat's Homepage
Don't worry. As I said, we have a work around.

Thanks everyone for your replies.

KatsKorner

Installation Help | http://ls3k.com/snitz/mods.asp" target="_blank">Snitz Mods | Forum Hosting
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07