Link to home
Start Free TrialLog in
Avatar of ggv
ggv

asked on

Putting text over an image

In order to save downloading time I would like to have one button image and then be able to programmatically put a number of different texts on the same image. I read, Nescape understands the LAYER tag, which might be used to accomplish this task. However I am looking to have a universal code that will run also on IE. Would be grateful for any hints how to do that.

ggv
Avatar of why2liz
why2liz

try <div class=myimage>text</div>
netscape suports it.. all major browsers suports it

add style
.myimage {
 bacground: ...
 color: ....
...
}
<style> .myimage { background: url(img/my.gif); } </style>

...to be more precisely and for points split ;))
also consider adding width: 100px; height: 200 px; to style above in order to match image size
Avatar of ggv

ASKER

Makc,  are you saying that if I add width and height then my image should be accordingly resized? Doesn't seem so if I try with jpeg files.

ggv
no. I am just saying you should set width/height for <div> to match image size, or it will look cropped, I think.
also, overflow:hidden; will help to avoid text overflow...
ASKER CERTIFIED SOLUTION
Avatar of devic
devic
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
if you have php on your server, i have another solution that would solve the problem much easier.
Avatar of ggv

ASKER

No, I do not have php unfortunately. I'll have to use devic's proposal.

Thanks a lot.

ggv
why devic's ? why2liz proposed essentially same thing... :-O