絶対配置と相対配置
とりあえずdiv stage上にdiv ballを置きましょう
--->test1.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>絶対配置</title>
<link rel="stylesheet" href="test1.css">
<script src="../jquery-3.4.1.min.js"></script>
</head>
<body>
<h1>絶対配置と<span class="green">相対配置</span></h1>
<div id="stage">
<div id="ball"></div>
</div>
<script src="test1.js"></script>
</body>
</html>
--->test1.css
body{
/*width: 500px;*/
/*height: 500px;*/
background: #eff;
}
.green{
color: #439918;
}
#stage{
width: 800px;
height: 400px;
margin: auto;
background: #000;
background-image: url(img/fish_kue2.png);
background-size: contain;
background-repeat: no-repeat;
}
#ball{
width: 20px;
height: 20px;
background: #fff;
border-radius: 10px;/*丸くする*/
}