Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a scrolling or static sidebar menu

Tags:

html

css

sidebar

I am looking for programming help on how to do a sidebar menu like the one shown at this URL:

Nettuts Website Link

I would like my sidebar to function just like the sidebar on the website, with my own look and feel applied to it. I would like the sidebar to scroll with the page fixed at its own location just as it functions on Nettuts website. How would I program this?

like image 473
Kevin Avatar asked Aug 24 '11 18:08

Kevin


2 Answers

It is a div with the css statement position: fixed; in the css class declaration.

Give any div in your html this CSS styling and you should see it working.

position: fixed;
height: 132px;
left: 0;
top: 185px;
width: 24px;
like image 91
vascowhite Avatar answered Oct 11 '22 16:10

vascowhite


that side bar is nothing more than a div with a fixed position.

<style>
.sidebar {
   width: 45px;
   height: 90px;
   position: fixed;
   left: 0px;
   top: 300px;
   border: 1px solid black;
}
</style>
<div class='sidebar'>I'm a sidebar</div>

http://jsfiddle.net/p8dFM/

At that point you add elements to the sidebar with whatever functionality you want.

like image 27
Kevin B Avatar answered Oct 11 '22 15:10

Kevin B