My goal is to have a button placed over a box, but I am facing difficulty achieving this.
I have experimented with z-index, grid-content, and other methods, but the button refuses to show over the box as desired. The placement of the button inside the box is crucial for me.
Here is my HTML code attempt:
#content {
width: 300px;
height: 100px;
overflow: hidden;
position: relative;
background: orange;
}
input[type='button'] {
position: absolute;
right: -30px;
}
<div id="content">
<input type="button" value="Click me!" />
</div>
I anticipated that the button would overlay the box smoothly, while still remaining inside it.