#ss {
background-color: black;
width: 1500px;
height: 80px;
overflow-x: 0;
margin-top: -8px;
margin-left: -200px;
opacity: 0.5;
}
#as {
background-color: red;
width: 70px;
height: 40px;
}
#bd {
background-color: grey;
background-image: url("use.jpg");
}

<body id="bd">
<div id="ss">
<button id="as"> Click me </button>
</div>
</body>
&#13;
按钮标签不在div内工作,idk为什么,它在div之外工作但不在其中...
答案 0 :(得分:0)
当您向div添加负x轴边距时,您的按钮位于页面边界之外
更新:
保证金从身体中移除。
body {
margin: 0;
}
#ss {
background-color: black;
width: 1500px;
height: 80px;
overflow-x: 0;
margin-top: -8px;
/*margin-left: -200px; */ // this causes the issue
opacity: 0.5;
}
#as {
background-color: red;
width: 70px;
height: 40px;
}
#bd {
background-color: grey;
background-image: url("use.jpg");
}
<body id="bd">
<div id="ss">
<button id="as"> Click me </button>
</div>
</body>