Re: [css-d] Is there such a thing as a sub class (in css not society)

2009-07-24 Thread Climis, Tim
Thanks, but that doesn't really answer my question.

What I want is an empty class that has no specific meaning itself but 
extends another class.

This is fine when I have an element within an element because I can set 
a style for .parent .child

I can also set a specific element's style using #child .child

I can also say that an element adopts 2 styles with .english .child

To partly answer my question I could specify .tall . child where tall is 
20% above average

But what if a .tall .parent is only 10% taller?

-

Isn't that what .tall.parent does?

.tall.parent {height: 110%}
.tall.child {height:120%}

---Tim
__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Is there such a thing as a sub class (in css not society)

2009-07-23 Thread Chris Price
Atkinson, Sarah wrote:
> U can set multiple  style classes to an item. Also u can use the 
> cascade. So u can set styles for all of the .thisHead And then set 
> styles that are only for .pullout .thisHead
>
>> I have a 'comment' class which follows a set
>> format except its width changes depending whether it is a short or
>> medium length.
>>
>> So I tried class="comment wide" but that doesn't work because .wide is
>> not set explicitly, only within another style. The alternative is to
>> have a narrowComment class and a wideComment class because a wide class
>> with a set width means it can only apply to a 'comment' element.
>>
>> I've used .larger and .smaller in the past but I have to specify the
>> increment which gives me no flexibility.
>>
>> It would be simpler if I were dealing with IDs because I could style my
>> #comment and add a .wide class and then specify the style for #comment
>> .wide in my style sheet.
>>
>> But 'Comment' is not an object, its a type.
>>
>> So, in effect, I'm looking for a sub class. Does this make sense and is
>> there a logical solution that's portable and not too exotic?
Thanks, but that doesn't really answer my question.

What I want is an empty class that has no specific meaning itself but 
extends another class.

This is fine when I have an element within an element because I can set 
a style for .parent .child

I can also set a specific element's style using #child .child

I can also say that an element adopts 2 styles with .english .child

To partly answer my question I could specify .tall . child where tall is 
20% above average

But what if a .tall .parent is only 10% taller?

-- 

Kind Regards


  Chris Price
  Choctaw

chris.pr...@choctaw.co.uk 
www.choctaw.co.uk 

Tel. 01524 825 245
Mob. 0777 629 0227

Choctaw Media
Fertile Ground for Websites

Follow me on Twitter 
Catch up with me on LinkedIn 

Its a Living Thing~~

 >> Sent on behalf of Choctaw Media Ltd <<

~~

Choctaw Media Limited is a company registered in
England and Wales with company number 04627649

Registered Office: Priory Close, St Mary's Gate,
Lancaster LA1 1XB, United Kingdom.

__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Is there such a thing as a sub class (in css not society)

2009-07-23 Thread David Dorward
To address the subject line before getting to the actual problem
described: No. HTML classes (which CSS class selectors select) are not
classes in the sense used in traditional OO programming. They are
classes in the wider sense.

   4: a collection of things sharing a common attribute; "there
  are two classes of detergents" [syn: category, family]
-- Wordnet

So throw all thought about OO programming concepts away when thinking
about classes in terms of HTML and CSS.

2009/7/23 Chris Price :
> So I tried class="comment wide" but that doesn't work because .wide is
> not set explicitly, only within another style. The alternative is to
> have a narrowComment class and a wideComment class because a wide class
> with a set width means it can only apply to a 'comment' element.

> It would be simpler if I were dealing with IDs because I could style my
> #comment and add a .wide class and then specify the style for #comment
> .wide in my style sheet.

You can combine multiple classes selectors too:

.comment.wide { }

But support is lacking in IE6.

-- 
David Dorward 
__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Is there such a thing as a sub class (in css not society)

2009-07-23 Thread Atkinson, Sarah
U can set multiple  style classes to an item. Also u can use the  
cascade. So u can set styles for all of the .thisHead And then set  
styles that are only for .pullout .thisHead

Sent from my iPhone

On Jul 23, 2009, at 7:56 AM, "Chris Price"   
wrote:

> I want to rationalise my css so that I am not continually inventing
> classes when I want to create a new effect.
>
> Today I have created a 'pullout' class which has a head, image and  
> body.
>
> I don't want to use an H? because I don't know where that element is
> going to sit in a document and I don't want to have to undo any styles
> set previously.
>
> So I have .thisHead and .thisImg which are not styled explicitly but
> within their context, e.g. .pullout .thisHead {}. This means I have to
> re-style .thisHead whenever it belongs to a different parent but at
> least I don't have to invent a new class name.
>
> So far so good. But now I have a 'comment' class which follows a set
> format except its width changes depending whether it is a short or
> medium length.
>
> So I tried class="comment wide" but that doesn't work because .wide is
> not set explicitly, only within another style. The alternative is to
> have a narrowComment class and a wideComment class because a wide  
> class
> with a set width means it can only apply to a 'comment' element.
>
> I've used .larger and .smaller in the past but I have to specify the
> increment which gives me no flexibility.
>
> It would be simpler if I were dealing with IDs because I could style  
> my
> #comment and add a .wide class and then specify the style for #comment
> .wide in my style sheet.
>
> But 'Comment' is not an object, its a type.
>
> So, in effect, I'm looking for a sub class. Does this make sense and  
> is
> there a logical solution that's portable and not too exotic?
> -- 
>
> Kind Regards
>
>
>  Chris Price
>  Choctaw
>
> chris.pr...@choctaw.co.uk 
> www.choctaw.co.uk 
>
> Tel. 01524 825 245
> Mob. 0777 629 0227
>
> Choctaw Media
> Fertile Ground for Websites
>
> Follow me on Twitter 
> Catch up with me on LinkedIn  >
>
> Its a Living Thing~~
>
>>> Sent on behalf of Choctaw Media Ltd <<
>
> ~~
>
> Choctaw Media Limited is a company registered in
> England and Wales with company number 04627649
>
> Registered Office: Priory Close, St Mary's Gate,
> Lancaster LA1 1XB, United Kingdom.
>
> __
> css-discuss [cs...@lists.css-discuss.org]
> http://www.css-discuss.org/mailman/listinfo/css-d
> List wiki/FAQ -- http://css-discuss.incutio.com/
> List policies -- http://css-discuss.org/policies.html
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


[css-d] Is there such a thing as a sub class (in css not society)

2009-07-23 Thread Chris Price
I want to rationalise my css so that I am not continually inventing 
classes when I want to create a new effect.

Today I have created a 'pullout' class which has a head, image and body.

I don't want to use an H? because I don't know where that element is 
going to sit in a document and I don't want to have to undo any styles 
set previously.

So I have .thisHead and .thisImg which are not styled explicitly but 
within their context, e.g. .pullout .thisHead {}. This means I have to 
re-style .thisHead whenever it belongs to a different parent but at 
least I don't have to invent a new class name.

So far so good. But now I have a 'comment' class which follows a set 
format except its width changes depending whether it is a short or 
medium length.

So I tried class="comment wide" but that doesn't work because .wide is 
not set explicitly, only within another style. The alternative is to 
have a narrowComment class and a wideComment class because a wide class 
with a set width means it can only apply to a 'comment' element.

I've used .larger and .smaller in the past but I have to specify the 
increment which gives me no flexibility.

It would be simpler if I were dealing with IDs because I could style my 
#comment and add a .wide class and then specify the style for #comment 
.wide in my style sheet.

But 'Comment' is not an object, its a type.

So, in effect, I'm looking for a sub class. Does this make sense and is 
there a logical solution that's portable and not too exotic?
-- 

Kind Regards


  Chris Price
  Choctaw

chris.pr...@choctaw.co.uk 
www.choctaw.co.uk 

Tel. 01524 825 245
Mob. 0777 629 0227

Choctaw Media
Fertile Ground for Websites

Follow me on Twitter 
Catch up with me on LinkedIn 

Its a Living Thing~~

 >> Sent on behalf of Choctaw Media Ltd <<

~~

Choctaw Media Limited is a company registered in
England and Wales with company number 04627649

Registered Office: Priory Close, St Mary's Gate,
Lancaster LA1 1XB, United Kingdom.

__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/