Reputation: 55
I am trying to edit a way text is displayed when "browsed-to" with the help of HTML section id code. Here is a snippet of my code:
<span class="headerqmain"><ul><li><a href="#ID001">Question</a></ul></li></span>
<section id="ID001"></section>
<span class="headerq">Question repeated</span>
<span class="answerq">Answer to the question</span>
Mind you that there are more than 100 questions, and the answers in the bottom of the page are long. Which means that when someone clicks the questions, they dump down to a list with the same questions and its answer below it. (this is a faq section). But its hard to see the forest for the trees.
So my aim is to mark up the clicked question+answer that was jumped down to. Maybe marking it up with a color, or with bigger text size. Anyone knows of if conditions can be used on CSS in this case? Remember its all on same page.
Upvotes: 3
Views: 798
Reputation: 14739
Sample code for what you could do with your markup when jumped to:
:target .headerq { /* :target would refer to #ID001 in this case */
font-size: 1.5em;
color: blue;
}
:target .answerq {
color: blue;
}
http://css-tricks.com/on-target/ for more info about this technique. Also check out http://37signals.com/svn/archives/000558.php for the yellow fade technique. A nice enhancement to this type of behavior
Upvotes: 1