I am using an input type image inside a div container. The image is a button. I would like to add text to this image in the center from the indentation of Left to Right. I am unable to get around it. Is the text hidden behind the image or is not at all getting displayed?
.container {
position: relative;
width: 100%;
height: 0;
padding-top: 56.25%;
}
.container>* {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.button {
position: absolute;
left: 0%;
top: 50%;
margin: auto;
transform: translateY(-50%);
height: 50%;
width: 50%;
overflow: hidden;
z-index: 2;
display: block;
}
</style>
<div class="container">
<input type="image" class="button submit" src="https://picsum.photos/200" alt="submit" value="This is my text"/>
</div>