如何在页面中链接到它们之后突出显示文本引用和尾注引用

时间:2017-07-27 21:36:38

标签: html bibliography citations

我通过以下方式将我的引文链接到我的尾注和我的参考书目尾注:

<h1>Title</h1>
<hr />

<p>This is a citation where "[1]" links to "&uarr;" in Endnotes and vice-versa.<a id="citation1" href="#endnote1"><sup>[1]</sup></a></p>

<h1>Endnotes</h1>
<hr />

<ol>
 <li><a id="endnote1" href="#citation1">&uarr;</a>This is an endnote where this <a href="#Short title of reference"><i>Short title of reference</i></a> links to entire <i>reference</i> in Bibliography.</li>
</ol>

<h1>Bibliography</h1>
<hr />

<ul>
 <li><a id="Short title of reference">Here goes the entire <i>reference</i>.</a></li>
</ul>

哪个收益率:

标题

这是一个引用,其中&#34; [1]&#34;链接到&#34;↑&#34;在尾注中,反之亦然。 [1]

尾注

     
  1. ↑这是一个尾注,其中简称参考标题链接到参考书目中的整个参考
  2. 参考书目

       
    • 这里是整个参考

    现在我希望当相应的链接转到我时,会突出显示[1],↑和简短引用标题的项目。怎么能实现这个目标呢?

1 个答案:

答案 0 :(得分:0)

这是:

  <h1>Title</h1>
  <hr/>

  <p>This is a citation.<sup><a id="citation_1" href="#endnote_1" onfocus="highlight(this)" onblur="deHighlight(this)">[1]</a></sup></p>

  <h1>Endnotes</h1>
  <hr/>

  <ol>
    <li><a id="endnote_1" href="#citation_1" onfocus="highlight(endnote_1Content)" onblur="deHighlight(endnote_1Content)">&uarr;</a><span id="endnote_1Content">This is an endnote citing this <abbr title="Full book title"><a href="#bibliography_1">Short title</a></abbr> for a book.</span></li>
  </ol>

  <h1>Bibliography</h1>
  <hr />

  <ul>
    <li><a id="bibliography_1" href="#" onfocus="highlight(bibliography_1Content)" onblur="deHighlight(bibliography_1Content)"></a><span id="bibliography_1Content">This is a reference for the entire book.</span></li>
  </ul>

  <script>
    function highlight(x) {
      x.style.background = "lightgrey";
    }

    function deHighlight(x) {
      x.style.background = "";
    }
  </script>