我有一个方框,想把按钮放在方框上面。
我已经尝试过使用z-index、grid-content等方法,但是按钮没有显示在上方,按钮必须在方框内部。
Html:
#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>
我希望按钮覆盖在方框之上,而不是按钮必须在方框内部。