adrasteia1:
You probably could do it with CSS, but it would be awkward. You could probably use display: none to hide things and have its state change on hover or click
Yes... but you're missing the key part. Every website uses CSS and CSS does control display elements, but CSS sets how an element is rendered.
Javascript is then needed to change the "display: none" to "display: block". You tie the javascript call into a hyperlink and do an "onclick" event.
The main menu (and W-P) search, for example, does this:
- The initial CSS sets the search block to visible.
- Javascript then immediately sets it to none.
- When you click on "Browse / Search the Games" javascript fires again, changing display back to block.
Only step 1 is done if the user has javascript disabled, thus the section is left visible.
Without javascript you have to use CSS3 something like :hover (which will result in lists collapsing when users don't want them to) or :focus (which again can result in the list collapsing an undesirable times). It also relies on a very pretty modern and fully featured browser that some of the trickier things in CSS2.1 and 3. I think the changes of someone not having javascript is a lot lower than the chance that all the prerequisites you CSS only would line up.