CSS-HtmlNo Comments

default thumbnail

We can make the left slidebar fixed even when scrolling the body scroll. It will be fix using css.

HTML

<div class="sidebar">
    <ul>
         <li>Home</li>
         <li>About</li>
         <li>Contact</li>
    </ul>
</div>

Suppose we want to fix this div in left side even when scrolling the body scroll.

CSS

.sidebar{ 
    position:fixed;
    left:0px;
    top:0px;
    width:200px;
    height:100%;
    background:#eee;
    z-index:999;
}

Be the first to post a comment.

Add a comment