1

I've go a somewhat silly question... Cant figure out how to create a button with image So far I've come to the the

<form>
    <input type="button" value="back" onclick="history.back()">
</form>

Instead of "back" button I would like to have f.e images/back.jpg button

Do i need to create a new class button in css?

Thank you!

2 Answers 2

1

You can use <button> tag and image as html content.

<button type="submit" name="someName" value="someValue" onclick="history.back()">
  <img src="https://i.sstatic.net/IX7ZV.png" alt="SomeAlternateText">
</button>

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, is there a possibilty to remove that button frame around the original button picture?
0

You could use a background url style on the button.

<button class="button"></button><br>
<input class="button" type="button" onclick="history.back()">
<style>
.button {
  height:50px;
  width:50px;
  background: url(https://lh3.ggpht.com/sqPcTNRtM6vc4pzWXWXIR6KxnRwbIz4LIYKvqwr1l__gPYkx24sV4Ak1oc2sN99dVA=w300);
  background-size: 100% 100%;
}
</style>

See fiddle

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.