0
settingsBox
요소를 아래쪽이 아닌 캔버스 위로 띄우고 싶습니다. 원하는 결과를 얻으려면 스타일 시트에서 무엇을 변경할 수 있습니까? 먼저요소를 다른 요소 위에 둡니다
<!DOCTYPE html>
<html>
<head>
<style>
body {
text-align: center;
margin: 0px;
}
#fullCanvas {
width: 100%;
height: 100%;
background-color: blue;
z-index: 0;
}
#settingsBox {
width: 400px;
height: 400px;
z-index: 1;
border: 2px solid black;
background-color: lightgrey;
padding-left: 0;
padding-right: 0;
margin-left: auto;
margin-right: auto;
margin-top: 25px;
}
</style>
<script>
function hideSettings() {
document.getElementById('settingsBox').style.visibility = 'hidden';
}
</script>
</head>
<body align="center">
<canvas id="fullCanvas">
This site requires html5 etc
</canvas>
<div id="settingsBox" onclick="hideSettings()">
Settings go in here. Click to hide
</div>
</body>
</html>
설정 상자에 다음을 추가해보십시오. position : absolute; 상단 : 0; 왼쪽 : 0; – ximi