Hadzher
0
Q:

html image button

<input type="image" src="http://example.com/path/to/image.png" />
1
<p>Sign in to your account:</p>

<div>
  <label for="userId">User ID</label>
  <input type="text" id="userId" name="userId">
</div>

<input type="image" id="image" alt="Login"
       src="/media/examples/login-button.png">

.output {
    font: 1rem 'Fira Sans', sans-serif;
}

label {
    font-size: .8rem;
}

label,
input[type='image'] {
    margin-top: 1rem;
}

input[type='image'] {
    width: 80px;
}
2
.container {
  position: relative;
  width: 50%;
}

/* Make the image responsive */
.container img {
  width: 100%;
  height: auto;
}

/* Style the button and place it in the middle of the container/image */
.container .btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  background-color: #555;
  color: white;
  font-size: 16px;
  padding: 12px 24px;
  border: none;
  cursor: pointer;
  border-radius: 5px;
}
1

New to Communities?

Join the community