Fixed div while content scroll

Sunday 2 July 2017















Starting from scrap take a div element name its id='div'
1.HTML Part

<div id='div'>
Here this Div block will stay fixed in respect of the page,you can scroll the page but div will stay fixed
</div>


2.CSS Part

#div
{
width:200px;
height:200px;
background-color:green;
//optional
position:fixed;
bottom:0px;
right:3px;
text-align:justify;
//optional
}


All done save and run.

Press the Result tab to view the output
See the Pen fixed div while content scrolls by Amrish Sharma (@AmrishSharma) on CodePen.

Labels: , , , , ,

0 comments:

Paste Long Url