position: relative div を含む position: absolute div を使用するサイトで作業しています。私は自分が信じている概念を理解しており、top
属性を取得して何もできないように見えることを除いて、すべてがうまく機能しています。left は機能しますが、top は機能しません。私のコードは次のとおりです。
<div id="imagemenu">
<div class="west">
<img src="/makingmusicstore/wp-content/themes/makingmusic/img/west.png" alt="west">
</div>
<div class="southwest">
<img src="/makingmusicstore/wp-content/themes/makingmusic/img/southwest.png alt=" southwest ">
</div>
<div class="south ">
<img src="/makingmusicstore/wp-content/themes/makingmusic/img/south.png " alt="south ">
</div>
<div class="logo ">
<img src="/makingmusicstore/wp-content/themes/makingmusic/img/logo.png " alt="Making Music Store ">
</div>
</div>
CSS
#imagemenu {
position: relative;
}
.logo img {
position: absolute;
width: 20%;
top: 50%;
left: 40%;
}
.west img {
position: absolute;
width: 30%;
left: 15%;
}
.southwest img {
position: absolute;
width: 30%;
left: 15%;
}
.south img {
position: absolute;
left: 35%;
}
このサイトは adams-web.net/makingmusicstore で、現在、top 属性が機能するようになるまで混乱しています。ロゴはページのずっと下にあるはずですが、私が信じているように機能していません。何が欠けているのかわかりません。位置を静的に変更すると機能しますが、位置が正しく保持されません。