Search code examples
htmlcsscss-positionfixed

Position fixed on div element


I am trying to give position fixed to the following div. But when i add position:fixed to css the element just disappears. Any suggestions will be appreaciated. Thanks!

Victoria

web and code below

http://vtwg.eu/ZMT/untitled3.html

<div id="book-now">
<a href="mailto:musictours@zzkrecords.com?subject=Music_Tours"><img 
src="book_now.png" alt="" width="90"></img></a>
</div>


#book-now{

background-image: url("back_2.png");
background-repeat: repeat;
text-align: right;
padding-right: 60px;
padding-top: 40px;
}

Solution

  • fixed elements are fixed in the browser . You have to define where you want it to be fixed by giving values of it top and right property

      position:fixed;
      top: 100px;
      right: 100px;