enter image description hereイメージ上にdivを中心に配置しようとしていますが、コンテナの相対位置と要素を絶対位置に配置しようとしましたが、動作しませんでした。イメージはフルサイズの背景であり、コンテナはその上に中央に配置する必要があります。イメージ上にdivを配置できません
.circle123{
position: relative;
float: none;
width: 600px;
height: 200px;
top: 0;
margin-right:auto;
margin-left:auto;
text-align: center;
border: 1px solid black;
}
#circle1{
position: absolute;
display: inline-block;
height: 150px;
width: 150px;
margin: 10px;
padding: auto;
border-radius: 50%;
background-color: rgba(50,205,50, 0.75);
}
#circle2{
position: absolute;
display: inline-block;
height: 150px;
width: 150px;
margin: 10px;
padding: auto;
border-radius: 50%;
background-color:rgba(135,206,235, 0.75);
}
#circle3{
position:absolute ;
display: inline-block;
height: 150px;
width: 150px;
margin: 10px;
padding: auto;
border-radius: 50%;
background-color: rgba(220,20,60, 0.55);
}
.back-bar{
display: inline-block;
width: 100%;
height: 100%;
background: url(image.jpg);
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
background-position: center center;
}
<div class="back-bar"></div>
<div class="circle123">
<div id="circle1"><h2>1<h2></div>
<div id="circle2"><h2>2<h2></div>
<div id="circle3"><h2>3<h2></div>
</div>
</div>
は、画像を見ることができない、本当にあなたが本当に必要なものをフォローすることはできません。あなたはよりミニマルな例を提供できますか? – markusthoemmes
何をしたいですか?箱の中の飾りを中心にする?左から右、または1つの場所のすべての円のように、divの中央にありますか? h2をcirlceの中心に置きますか?少し説明してください。 – Varin
写真を追加しました。画像の中央に.circle123のコンテナを配置します。 –