I would like to make a button (clickable element) without text but with an image.
I want the image to be defined in the css.
If I use Image element, the image cannot be defined in the css.
Using div looks like irrelevant.
something like:
<elem></elem>
elem {
backround-image:url(img.jpg);
}
How can I do this? What is elem?
You can use a button element by reseting it’s defaults CSS, Or use DIV.
Button is more semantic.
Obviously you will still need to add an event handler to the onclick event for it to do something.
Example: