I’ve been trying to make a button from an image, but I’m not sure how to remove the border and background from it. Is there any way I could have the image act as a button?
And this is my code:
<a title="Go to the card store?" href="https://site"><button type="button"><img src="cardspin.gif" width="200" height="200"></button></a>
I’ve tried making a custom button class in my .css file, but it didn’t do anything. This was the code I used, trying to make the class.
.transparent_button {
background-color: transparent;
border: 0px;
}
It’s a pretty simple kind that just leads to another page of my site when clicked, if that has anything to do with it…
2
Answers
You need the image as a
.png
file. You remove the background in Photoshop.To me it looks like, based on the implementation of your code, the only functionality of clicking the button is taking you to the card store.
A button is generally used to perform some kind of action, like submitting a search request or adding an item to a shopping list. I cannot see any action required in your code provided, therefore I would say that you really only require the anchor tag: