2011-11-18 105 views
0
<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文件中有類似上面的代碼。它顯示的內容 -將靜態目錄添加到html

=====   ==== 
tag1   tag2 
=====   ==== 
-------------------- 
    help.html 

    Intro 
    some intro. 
    basics 
    some basic info. 
    and more contents 
-------------------- 

現在我想「的內容表」添加到的help.html.so用戶可以很容易地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和谷歌幫助幾件事情,但我不知道如何得到它 正確。謝謝你的幫助。

回答

1

這可以很容易地使用position: fixed財產CSS來實現:

div.table-of-contents { 
    position: fixed; 

    right: 30px; 
    top: 30px; 
} 

見我的演示在這裏:http://jsfiddle.net/yDBPZ/3/

+0

感謝您的幫助,攪拌機。 –