At 07:07 PM 4/9/2005, Adam Pasztory wrote:
>But you have to admit that there is quite a bit of overlap. That is, you
>(So I wouldn't call it an orthogonal relationship.) For example, you can
>implement a link hover effect with either one.
>Is the general opinion of people on this list that, given the choice
>between a CSS implementation and a JS implementation, CSS is
>preferable? Are there any exceptions?
Ha, you're asking the members of a CSS listserve if they prefer CSS or
The question of whether to choose one or the other never really comes up,
in my experience. That very narrow band of overlap between CSS &
logic looping, and the modification of the DOM are outside of CSS's
as hiding & showing blocks via the display property or the toggling of a
active script that can interact with the user or other environmental
variables. You may be thinking of Microsoft's expression() technology
In my view, in that very narrow band of overlap between the two
technologies, CSS is definitely preferable. It's my impression that CSS is
supported more widely across browsers (albeit with variances) and can't as
easily be -- isn't as commonly -- turned off by the user.
Just look at the aspect of graceful degrading. If CSS isn't supported by a
browser, the page falls back to vanilla HTML rendering which is generally
going to present the user with a page that's perfectly functional, just
it's usually some functionality that's missing and the page will tend to be
broken. (Exceptions are easy to imagine; I'm talking general cases.)
I use client-side scripting very sparingly these days, and then only for
non-critical functionality such as input validation or dynamic features
that are in every case backed up by redundant server-side equivalents, so
actions in microseconds that take several seconds in a round trip to the
server & back.
In contrast, I use CSS in every page I write, whether scripting is present
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/