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
[email protected] <mailto:[email protected]>
www.choctaw.co.uk <http://www.choctaw.co.uk>
Tel. 01524 825 245
Mob. 0777 629 0227
Choctaw Media
Fertile Ground for Websites
Follow me on Twitter <http://twitter.com/choctaw>
Catch up with me on LinkedIn <http://www.linkedin.com/in/spoonfulofdreams>
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 [[email protected]]
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/