Floating sticky div

A fun and supersimple way to make your navigation menu, shop/gallery stream (or anything you want really) stand out. I previously used this to advertise my Etsy shop stream ;)
 

 

Step 1: This is a normal div; can be altered/placed wherever you like using CSS. The key to making the div stick and float on top of all else is ‘position:fixed’ and ‘z-index:100′. Insert the following into your external .css (external files make things soo much more organised!):

.sidebar {
    width: 100px;
    height: 420px;
    bottom:0px;
    right:0px;
    background-color:#FFFFFF;
    text-align:center;
    padding-top:5px;
    position:fixed;
    z-index:100;
    }

 

Step 2: Insert the next snippet into your HTML page somewhere within the <body></body> tags:

<div class="sidebar">Insert content here.</div>

Comments are closed.