0

i want to put text into an image using css.

i saw a few codes that tell you to put div inside a div.
make one div relative and the other absolute.

the problems that i have is that i already have a relative div outside the picture.

can anyone help?

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by johnsteve.bravo
1

just create 2 divs, like this:

<div id="image">
 <div id="text">
  Some Text
 </div>
</div>

set the background of div#image to your image file:

#image {background: URL('image.png');}

and then you have the text inside the image.
there is no need to use relative or absolute positions

Votes + Comments
Thank you
0

awesome ... thanks. how do i stop it from repeating?

i put this..:
#image {background-image:url(Ebay/Images/EbayLogo.gif); background-repeat:no-repeat}


but it keeps repeating

0
#image {background: URL('Ebay/Images/EbayLogo.gif') no-repeat;}

just try it like this :)

0

If you have a jpg,png or other such image and you want to add some text to it, then you can simply create a div with the following css.

.txtdiv
{
position:absolute;
left:100px;
top:500px;
}

Don't forget to adjust the pixel values for left and top so that it would be placed on the desired part of the image.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.