I am attempting to include a banner div
<div id='banner'></div>
above an existing webpage in a way that the banner stays on top when scrolling, while also pushing the content down so all parts of the page are still accessible.
Below is my CSS:
#banner {
position:fixed;
display:block;
top:0px;
background-color:#FFFFFF;
width:100%; height:250px;
border:2px solid;
}
And this is the jquery I used:
$("body").prepend("<div id='banner'></div>");
Even after trying to change fixed divs to relative using jquery before adding the banner, it still doesn't work. The error can be seen in the image link here.
Any assistance would be greatly appreciated.
Just to clarify, this task is simply for practice and not for generating ad revenue.