学校のクラブの 1 つのフロント エンドを開発していますが、2 つのインライン要素を重ねて配置するのに問題があります。私はこれに数晩立ち往生しており、本当に動揺しています. マージン、ポジショニング、インラインブロックからすべてを試しましたが、いずれも問題が発生するようです。今、頭がおかしいのでこちらを向いています。要素は要素の上にあると想定されます。両方の要素は、画像の隣にあると思われるプレーヤーにあります。コードをダウンロードするためのリンクを含めます。問題が発生している場所は、ブラウザでページを表示するとすぐにわかります。あなたが私に与えることができるどんな助けにも感謝します.
https://dl.dropbox.com/u/21141217/HvZ.zip
編集:ここで問題が発生しています
<div id="recentTags">
<h4>RECENT TAGS</h4>
<div class="tag">
<div class="player">
<a href="">Chris Stephenson</a>
<h6>Legends</h6>
</div>
<img src="tag.png" alt />
<div class="player">
<a href="">Eric Tadt</a>
<h6>butt pirates</h6>
</div>
</div>
<div class="tag">
<div class="player">
<a href="">Zack Baer</a>
<h6>Little Bears</h6>
</div>
<img src="tag.png" alt />
<div class="player">
<a href="">Humble Trumble</a>
<h6>Glorious pres</h6>
</div>
</div>
</div>
関連する CSS:
#recentTags{
width: 292px;
padding: 4px;
height: 236px;
/*My attempt at trying to recreate the color gradient. Gabe fix it*/
/*I used http://www.colorzilla.com/gradient-editor/ or you can just google css gradient generator*/
background: #5e5e5e; /* Old browsers */
background: -moz-linear-gradient(top, #5e5e5e 0%, #000000 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#5e5e5e), color-stop(100%,#000000)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #5e5e5e 0%,#000000 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #5e5e5e 0%,#000000 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #5e5e5e 0%,#000000 100%); /* IE10+ */
background: linear-gradient(to bottom, #5e5e5e 0%,#000000 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5e5e5e', endColorstr='#000000',GradientType=0 ); /* IE6-9 */
}
#recentTags h4{
color: #D23000;
background-color: grey;
padding-left: 8px;
/*Color gradient*/
background: #2d2d2d;
background: -moz-linear-gradient(left, #2d2d2d 0%, #4c4c4c 100%);
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#2d2d2d), color-stop(100%,#4c4c4c));
background: -webkit-linear-gradient(left, #2d2d2d 0%,#4c4c4c 100%);
background: -o-linear-gradient(left, #2d2d2d 0%,#4c4c4c 100%);
background: -ms-linear-gradient(left, #2d2d2d 0%,#4c4c4c 100%);
background: linear-gradient(to right, #2d2d2d 0%,#4c4c4c 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2d2d2d', endColorstr='#4c4c4c',GradientType=1 );
}
.tag{
width: 280px;
height: 31px;
margin-top: 5px;
padding:3px;
border: 0px solid #829485;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
/*Gradient*/
background: rgb(30,87,153);
background: -moz-linear-gradient(top, rgba(30,87,153,1) 0%, rgba(255,255,255,1) 0%, rgba(53,53,53,1) 2%, rgba(73,73,73,1) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(30,87,153,1)), color-stop(0%,rgba(255,255,255,1)), color-stop(2%,rgba(53,53,53,1)), color-stop(100%,rgba(73,73,73,1)));
background: -webkit-linear-gradient(top, rgba(30,87,153,1) 0%,rgba(255,255,255,1) 0%,rgba(53,53,53,1) 2%,rgba(73,73,73,1) 100%);
background: -o-linear-gradient(top, rgba(30,87,153,1) 0%,rgba(255,255,255,1) 0%,rgba(53,53,53,1) 2%,rgba(73,73,73,1) 100%);
background: -ms-linear-gradient(top, rgba(30,87,153,1) 0%,rgba(255,255,255,1) 0%,rgba(53,53,53,1) 2%,rgba(73,73,73,1) 100%);
background: linear-gradient(to bottom, rgba(30,87,153,1) 0%,rgba(255,255,255,1) 0%,rgba(53,53,53,1) 2%,rgba(73,73,73,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#494949',GradientType=0 );
}
.tag a{
color: #D23000;
display: inline-block;
text-decoration: none;
font-size: 13px;
font-weight: bold;
position: relative;
bottom: 14px;
}
.player{
width:110px;
display: inline;
}
.tag img{position: relative;}
.tag h6{
display: inline;
}
ダブレット リンク: http://result.dabblet.com/gist/4007549/381ecd27edf3c72fbde28575ca9cd2e50e2c2a52
編集:要素の上に要素を配置する単語の選択を間違えたと思います。したがって、最終結果は次のようになります。
クリス・スティーブンソンの伝説