Positioning anchors beneath a fixed header
by audetwebdesign
HTML
<div id='header'>bunch of stuff and images</div>
<div class='nav'>
<a href='#test1'>test1</a>
<a href='#test2'>test2</a>
<a href='#test3'>test3</a>
</div>
<div class='content'>
<a name="test1"></a>
<div class='content-panel'>
<a>test1 project</a>
bunch of stuff
</div>
<a name="test2"></a>
<div class='content-panel'>
<a>test2 project</a>
bunch of stuff
</div>
<a name="test3"></a>
<div class='content-panel'>
<a>test3 project</a>
bunch of stuff
</div>
</div>
CSS
body {
margin: 0;
}
#header {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 1030;
margin-bottom: 0;
height:150px;
background-color: rgba(125,125,20,0.6)
}
.nav {
margin-top: 150px;
border: 0px solid blue;
padding: 10px;
width: auto;
border-bottom: 1px solid blue;
}
.content {
overflow: auto;
}
.content-panel {
background-color: lightgray;
margin: 0;
padding: 10px;
height: 400px;
}
a:target {
display: block;
line-height: 0;
margin-bottom: 150px;
}