向html中添加静态内容表

adding static table of content to html

本文关键字:静态 添加 html      更新时间:2023-09-26
<body>
    <div id="tag1"></div>
    <div id="tag2" class="tag2"></div>
    <div style="clear: both;">
    <iframe src="help.html" width="100%" height="300">
      <p>Your browser does not support iframes.</p>
     </iframe>
</body>

我在一个html文件中有上面的代码。它将内容显示为-

=====          ====
tag1           tag2
=====          ====
--------------------
  help.html 
  Intro
    some intro.
  basics 
    some basic info.
   and more contents
--------------------

现在我想在help.html的右侧添加"内容表",以便用户可以轻松访问help.html中的适当位置。例如

=====          ====
tag1           tag2
=====          ====
--------------------
help.html      Intro <----|
               basics <---| new thing I would like to add
               topic3 <---|
  Intro
    some intro
  basics 
    some basic info.
   and more contents
--------------------

我试图添加iframe和一些东西与谷歌的帮助..但我不知道如何得到它正确的。谢谢你的帮助。

这可以很容易地通过CSS使用position: fixed属性:

div.table-of-contents {
    position: fixed;
    right: 30px;
    top: 30px;
}

请看我的演示:http://jsfiddle.net/yDBPZ/3/