Okay, may cause a minor arguement - but am dying to know what others think...

Should we be using CSS to create special effects and behaviours on websites?
The whole point of CSS is apparently to help seperate Content from Style... but a third piece is missing, Behaviour!

Now, I know I have done it in the past, am actually doing it on two current projects too... I'm using CSS for fancy Dropdown/Slideout/Popup/whatever-you-call-them menus.

I've done a few galleris too... hover over the thumbnail, and get a nice pop-up of a larger version.

But should this sort of thing be done with CSS?

Strictly speaking, it is not "styling", it is behaviour.
Additionally, from an Accessibility point of view, it tends not to make a lot of sense;
You have a Thumbnail, then a larger version of it .... next to it!
The menus end up presenting a huge list of links on larger sites.... which few of use would ever have dreamed of doing before hand... we would have done "click-through" navigation in stead (making them click through the levels the old fashioned way!)... instead some sites present well over 100 links ina big chunk!

So, what are peoples thoughts on this?
Should we seperate things and keep it "pure"...

  • x/html for Content
  • CSS for Styling
  • JS/Flash for Behaviour

Or do you deem it perfectly fine to use CSS in such a manner ?

Recommended Answers

All 3 Replies

Please don't!

It is extremely ANNOYING when stuff happens when I move the mouse without clicking, or stuff happens just to get my attention. It makes me mad enough to hit the Back button and add the site to my list of no-no sites.

If a page has moving content, it had better be doing one of these:
- Demonstrating a concept with a moving illustration.
- Trying to drive users crazy.

People who write the pages think this stuff is "kewl" and that it shows off their abilities. People who read the pages think, "Not another show-off!" BACK!

In my case, the interruption from moving material is so strong that I can't read the text until the page stops moving. The purpose of that interruption is collision avoidance, but it misfires.

Okay - I'm more than a little confused by your response.

Though obviously heartfelt and sincere, I do not recollect nor see, (and I have re-read my post), anything that would have suggested any such content that you feel as annoying, (and I am more than inclined to agree with you!).

Instead, i refer to things such as, (re-iterating the above) things such as menu behaviours or minor visual occurences based upon user interation (such as :hover, :focus and :active).

Is that clearer?
I do not mean in any way shape or form the inclusion of animation, splash screens or even "pop-up windows"; I personally think such things should be band, or have a specific tag in there context so that browser devices can be set to ignore them.
I refer to menu's, visual indicatiosn of state and some forms of "collapsing/expanding" content (such as clicking a linkto dispaly more of an FAQ entry or the entire document instead of just the intro.).


Hoep that is clarified.
If so, I am more than itnerested in your comments.

I dislike ANY use of the hover attribute.

Clicking on somethintg is entirely different.

But I prefer that you open a new page to display a large text page, so I can use the BACK button to get rid of it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.