ChronicFatigue;10943407 wrote:
http://en.wikipedia.org/wiki/5htp#cite_note-1
On my site, references are on another page but I would like them highlighted like at Wikipedia; I would use CSS to highlight the listed item concerned.
Why do you even need to care about it server side? This is a client side issue. Unless I missunderstand you entirely.
page 1
<a href="page2.html#one">Reference 1</a>
<a href="page2.html#two">Reference 2</a>
<a href="page2.html#three">Reference 3</a>
page 2
<style type="text/css">
*:target {
background-color: #DDF;
}
</style>
</head>
<body>
<table>
<tbody style="font-size: 14px;">
<tr>
<td>1</td><td>2</td><td>3</td><td>4</td>
</tr>
<tr id="one">
<td>a</td><td>b</td><td>c</td><td>d</td>
</tr>
<tr>
<td>1</td><td>2</td><td>3</td><td>4</td>
</tr>
</tbody>
</table>
<ul>
<li id="two">
Alpha Bravo
</li>
<li>
1 2 3
</li>
</ul>
<div>
<p>
Lorem ipsum…
</p>
<p id="three">
… dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</div>
Here I made use of * (universal selector) to show that anything can have the target pseudo-element, assuming that it can have the id attribute (or in older browsers possibly the name attribute instead). For this to work, the user's browser actually has to handle the target pseudo element. Maybe they all do, maybe they don't. I really have no idea.
But this is how wikipedia does it anyway, which it takes less than 10 seconds to find out using the proper tools, which for me means Firefox with Firebug addon. Similar things exists for other browsers, as addons or built in.
1. Clicked your wikipedia link
2. R-clicked the highlighted text
3. In firebug, clicked: <li id="cite_note-1">
4. Read the style rule for this element: ol.references > li:target, sup.reference:target, span.citation:target
And since #stuff targets an element with id="stuff", you can't use a numeric "stuff", or to be more precise: "stuff" can't start with numerals.
html 4.01 wrote:
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").