as in Google news or pulsme land pages.
Obviously, the main advantage of this being when user scrolls down in the main document, the navigation-menu is still remains visible the screen.
I tried position:fixed
for the <td>
element. But the problem is that when the page is viewed on a mobile device (small screen) the text mixes with the main content. I am okay with the solution which is not table but preferably should not use any external libraries. I also tried <iframe>
… but could not get it running. Thanks!
Advertisement
Answer
The best solution would be to add a menu in a div and the content in another
JavaScript
x
3
1
<div id="menu">Some Menu Options</div>
2
<div id="cont">Your Content</div>
3
Then in CSS
JavaScript
1
12
12
1
#menu {
2
position: fixed;
3
top: 0;
4
left: 0;
5
height: 100%;
6
width: 150px;
7
}
8
#content {
9
position: relative;
10
margin-top: 100%;
11
}
12
Off course you could replace 150px
with any other value.