You might have seen floating content of web sites which is always visible on the page even if you scroll it. This is easy achieve thing by using just CSS. However there is also JavaScript alternative for this but the CSS one is smoother and faster as this doesn’t includes any run time calculation. The below step by step process will guide to how to add a always visible div on web page.

<style type=”text/css”>

<!–.visibleDiv

{    position: fixed;}

//–>

</style>
<style type=”text/css”>

<!–/*For top left*/

.visibleDiv

{    top: 10px;    left: 10px;}
/*For top right*/

.visibleDiv{    top: 10px;    right: 10px;}
/*For bottom left*/

.visibleDiv{    left: 10px;    bottom: 10px;}
/*For bottom right*/

.visibleDiv

{    bottom: 10px;

right: 10px;

}

//–>

</style>

 

Thank you . .

Advertisements