[ale] [OT] Stylesheet question

Kevin O'Neill Stoll kevinostoll at yahoo.com
Thu May 9 17:49:32 EDT 2002


From: http://www.w3.org/TR/REC-CSS1#class-as-selector
"Only one class can be specified per selector. 'P.pastoral.marine' is
therefore an invalid selector in CSS1. (Contextual selectors, described
below, can have one class per simple selector)"

I belive I understand what you are trying to achieve, which is re-use of
code? The logic you are trying to implement makes sense to me, I have
wanted to do that many times. Unfortunately, you can inherit implicitly
but not explicitly. 

As the example shows, http://www.w3.org/TR/REC-CSS1#inheritance, if you
define an element inside of another that has a styling, that element
inherits the style.

Otherwise, I guess you are left to defining multiple classes to do the
same work or just define your stylesheet based on elements, e.g. -
P.style, H1.style.

So have one style for regular Paragraphs P{ color:red; } and then another
for your class P.style{ color:white; )

Hope that helps.




--- Tyler Kiley <tyler at kianta.com> wrote:
> Typically, when you want to inherit styles, you don't need to inherit
> from 
> another class "laterally" in the stylesheet -- instead, define them in a
> 
> class or element that is used higher up in the html tree.  Is that not 
> possible?
> 
> Tyler
> 
> On Thursday 09 May 2002 04:08 pm, David Corbin wrote:
> > Tyler Kiley wrote:
> > >I don't know offhand what the syntax is for css inheritance
> ("Bar#Foo",
> > >maybe?), but the best place to get accurate information about web
> content
> > >standards is the w3c website (www.w3c.org).  They have the complete
> > >specifications for html 4.01, html 3.2, xhtml 1.0, xml, xsl/xslt,
> css1,
> > > css2, etc.... available on their site.  Very helpful.
> >
> > I've looked through (thought not thorougly studied) the spec.  The
> > problem is, what they call inheritance is not what I want to do.  I
> > didn't find anything, that did what I wanted, so I thought I'd check
> here.
> >
> > >Tyler
> > >
> > >On Thursday 09 May 2002 03:59 pm, David Corbin wrote:
> > >>I have a style class:
> > >>
> > >>.Foo {
> > >>color: white;
> > >>background-color: black;
> > >>.
> > >>.
> > >>. etc.
> > >>}
> > >>
> > >>Is there a way to define class ".Bar" where I say, start with
> everything
> > >>as if it were ".Foo", except for what I replace?
> > >>
> > >>Thanks.
> > >>David
> > >>(If someone knows a really good place to get answers to this type of
> > >>question, other than ALE, please let me know)
> > >>
> > >>
> > >>---
> > >>This message has been sent through the ALE general discussion list.
> > >>See http://www.ale.org/mailing-lists.shtml for more info. Problems
> should
> > >>be sent to listmaster at ale dot org.
> >
> > ---
> > This message has been sent through the ALE general discussion list.
> > See http://www.ale.org/mailing-lists.shtml for more info. Problems
> should
> > be sent to listmaster at ale dot org.
> 
> 
> ---
> This message has been sent through the ALE general discussion list.
> See http://www.ale.org/mailing-lists.shtml for more info. Problems
> should be
> sent to listmaster at ale dot org.
> 


=====
Kevin Stoll
http://kevinstoll.org

OpenSource Software ... FREE!
Angering Bill Gates ... Priceless!
================================

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Mother's Day is May 12th!
http://shopping.yahoo.com

---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list