How to make a fixed div?

taabouzeid picture taabouzeid · Jan 28, 2010 · Viewed 95.2k times · Source

I am trying to make box to be fixed in the lower right border of the page and doesn't move with the page scrolls down. But it's not working for me dunno why. Here is my code:

<html>
 <head>

 <style type="text/css">

.tooltip {
 width: 200px;
 position: fixed;
 top:auto;
 bottom:0px;
 right:0px;
 left:auto;
}
 </style>
 </head> 
<body>
<div class="tooltip">
   <div class="tooltip_top">1</div>
   <div class="tooltip_con">2</div>
   <div class="tooltip_bot">3</div>
 </div>
</body>
</html>

Answer

Gabriele Petrioli picture Gabriele Petrioli · Jan 28, 2010

It works fine in FF and Chrome ..

older versions of IE did not support position:fixed correctly .. not sure about latest version..

Also make sure you have a doctype defined ..