Installing the background. First, make sure the tank's back is very clean and dry. Then, attempt to slip the top edge of the background up underneath the top trim piece of the aquarium - just enough to make sure any water spillage will drip down the outside of the background, rather than between the background and glass. Square the background to the tank's back, then tape the top edge in place with any sort of water-resistant tape. Again, taping the whole length of the edge will keep water out. Next, trim the edges of the background, if necessary, to the size of the tank's back. Finally, tape all three remaining edges in place, preferably for their entire length.
This isn't original advice, I found it at Aquarium Backgrounds