views:

147

answers:

1

Hello,

I am trying to generate a html page with css that works as an image preview kind of thing. An example of this is here:

http://www.nomorepasting.com/getpaste.php?pasteid=22463

however this approach has several drawbacks. One of which is the text must always be smaller than the images. I tried using a different attempt here:

http://www.nomorepasting.com/getpaste.php?pasteid=22464

But could not get it to work. Would someone please be able to show me how to modify the code at the second link to work as the first, or to suggest an overall better method?

+3  A: 

Hi Josh,

the error in second one is you haven't specified the height attribute. Try the following, it worked for me.

.class1{color:#000; background-image:url('images/2.jpg');height:1000px;}

The reason you are not able to see the back ground image is, since there is nothing inside the div, and the height is not specified the height is 0. Try putting a few elements in the div and you will see that the image is being displayed.

Ramjee

rAm