Previous Message
Next Message

OO-CSS?

Sent by Olwe Bottorff on 5 March 2005 14:02


As a fairly new person to serious CSS who came from a
programming background, I'm a bit dismayed at the lack
of "object-oriented" capabilities of CSS. For example,
I've been trying to put together a blog-,
slashdot-style page where the peer blog items stack
one on top of the other on the page. To me a
programmer with C++/Java experience, this would
typically be a vector or array issue.

For example, I would create an object that had all the
"data" elements I needed for a blog or story entry,
call it "blog object". Then I would have probably a
"page object" that had an array data element of these
blog objects. All of the looknfeel/placement/design
elements of the individual blog objects would be
encapsulated within the blog object itself so that
when I deployed it, it would behave exactly as I
programmed it. Likewise, the page object would do
(stack) the individual blog objects as I
programmatically instructed.

I've been messing around with my blog page using CSS,
trying to be as OO as possible--and I've been thwarted
by a technology that still seems to lurk in
"Kludgeland," obviously nowhere near as bad a straight
HTML with all of its table abuse, pixel tricks, design
and content tossed salad, but still I am forced to
negociate a rather difficult, non-intuitive world of
"kludge-lite". Frustrating is how CSS seems to tip its
hat to OO, but not really give you full OO
capabilities. I've tried using ul and li, which to an
old programmer is the logical array/vector object in
HTML-land. Inside a li object I should be able to put
many other sub-objects like img, p, titles, etc. But
it's fairly obvious the ul/li combo is not really
meant for such use--without heavy kludging around with
it. I think I've been advised before to stick with div
tags. However, the way I've seen divs used is very
un-OO. So often before when I've used div tags they
quickly turned into a huge pile of one-off tricks to
get around the lack of good OO capabilities.

It was obvious to people when the Web first appeared
to dynamically generate content with Perl, Java, etc.,
but that did nothing for the huge style problem and
abstracting out the style from the content. CSS was
supposed to solve that, but there doesn't seem to be a
marriage of any programming language or its elegance
with CSS.  I haven't looked into XSLT or XUL, but I
fear they don't address what I'm saying here either.
Likewise, the wysiwyg tools only do what I'm saying in
the crudest sense--even though, ironically, this is
how Visual Basic started.

So, hopefully I haven't made to many enemies with my
complaints. Maybe this is my calling in life, i.e., to
OOize CSS.

Olwe


	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: