|
Posted by Ben C on 11/04/95 12:00
On 2006-09-29, Boonish <boog@felch.com> wrote:
> I have a page with a series of questions as links on the left, and
> paragraphs of answers in a column to the right. What I'd like to have
> happen is when the user clicks on a question to the left, the answer to
> the right changes it's background color slightly to draw attention.
>
> What's the easiest way of going about this? TIA.
You can use the :active pseudo
e.g.:
..question:active .answer
{
background-color: yellow;
}
<div class="question">
What's the difference between a duck?
<div class="answer">
One of its legs is both the same
</div>
</div>
You could use <dl>, <dt>, <dd> etc for the questions and answers, and
style them appropriately.
This might mean changing how your content's organized a bit. If the
answers are highly dissociated from the questions in the document
structure, it might be easier to use JS and "onclick" events.
[Back to original message]
|