我有一個關於錨標籤的問題。如何解決我的錨鏈接問題
我有一個像
<div id='header'>
bunch of stuff….and iamges
</div>
<div>
<a href='#test1>test1</a>
<a href='#test2>test2</a>
<a href='#test3>test3</a>
</div>
<div class='content'>
<a name='test1'>test1 project</a>
bunch of stuff
<a name='test2'>test1 project</a>
bunch of stuff
<a name='test3'>test1 project</a>
bunch of stuff
</div>
我的CSS
#header{
position: fixed;
right: 0;
left: 0;
z-index: 1030;
margin-bottom: 0
height:150px;
}
但是一個頁面,好像我點擊測試1到TEST3鏈接每一次,我的「內容」 DIV得到推到頂部我頭div。 所以我的'內容'div覆蓋我的頭div(150px)。有沒有辦法解決我的問題?非常感謝!
這就是你所有的CSS? – Lance
您正在使用'position:fixed',它從文檔流中移除元素。所以,其他內容將會重疊。你有什麼試圖解決它?你的嘗試出了什麼問題? – showdev