Combining a graphic with text on a button

R

Rod

Hi,

Does anyone know of a way to combine an icon with text on a pushbutton
without venturing too deeply into the murky world of the graphics library.

The icon is a gif loaded from a file but the text is read from a resource
and may be in any one of several languages so I probably need to create the
button logo on the fly using text in a string.

Any suggestions on how I can combine the two?
 
J

John Prado

You can achieve this by pure css:

input.MyButton{
background:url(icon.gif);
background-posision:left;
padding-left:20px;
}

That's it, you can play around with other css attributes to make your
button the way you want.

Ah, this approach works with links too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top