イメージの上にマウスを置くと、私のプロジェクトの説明が得られるようにしようとしています。私がspan.text-contentの位置をabsoluteに設定した場合、リストアイテムはすべて正しく整列しますが、左上隅に1つのボックスが表示され、下位の画像にスクロールすると表示されません。遷移が正しく整列していない
位置を相対に設定すると、すべての画像が区切られ、テキストボックスが画像の左側と下に表示されますが、少なくとも画像ごとに1つずつ表示されます。私はZインデックスを使って遊んできました。なぜなら、最初は、「説明」という言葉がトップイメージの後ろにあるスライバーとしてしか見ることができなかったからです。
最後に、my -o-transitionはグレーアウトされず、それについてはわかりません。私はjshintをチェックしたが、何のエラーも投げていない。助けを前にありがとう!
HTML
<li>
<!--Dance Class-->
<img src="images/dance.jpg" id="port-img" width="797px" height="307px"/>
<span class="text-content"><span>Explanation</span></span>
</li>
<li>
<!--That's Not Food-->
<img src="images/tnf.png" id="port-img" width="797px" height="307px"/>
<span class="text-content"><span>Explanation</span></span>
</li>
<li>
<!--That's Not Food Pitch-->
<img src="images/tnf-pitch.png" id="port-img" width="697px" height="500px"/>
<span class="text-content"><span>Explanation</span></span>
</li>
<li>
<!--Coaches Corner-->
<img src="images/coach.jpg" id="port-img" width="697px" height="500px"/>
<span class="text-content"><span>Explanation</span></span>
</li>
<li>
<!--Singularity2045-->
<img src="images/Singularity2045.png" id="port-img" width="697px" height="733px"/>
<span class="text-content"><span>Explanation</span></span>
</li>
<li>
<!--Overtime-->
<img src="images/overtime.png" id="port-img" width="697px" height="500px"/>
<span class="text-content"><span>Explanation</span></span>
</li>
</ul>
**CSS:**
span.text-content {
/* allows me to adjust the filters and transparency of the outer span/image */
background: rgba(0,0,0,0.5);
color: white;
cursor: pointer;
display: table;
font-size: 1.5em;
height: 300px;
left: 0;
position:absolute;
top: 0;
width: 500px;
opacity: 0;
-webkit-transition: opacity 500ms;
-moz-transition: opacity 500ms;
-o-transition: opacity 500ms;
transition: opacity 500ms;
z-index: 1;
}
span.text-content span {
/* For text alignment */
display: table-cell;
text-align: center;
vertical-align: middle;
}
ul.img-list li:hover span.text-content{
opacity: 1;
}
#port-img{
z-index: 1;
position: relative;
top: 69px
}
コードサンプルまたはコードサンプルを提供することができますか?私はあなたが何を説明しているのかよく分からない。また、-o-transitionについても触れました。問題は特にOperaにあるのですか? – user5775386
スタックオーバーフローへようこそ:-) [ask]と[mcve]の作成方法を見てください。これは便利な回答を得るのに役立ちます。 – JimHawkins
@ user5775386いいえ、Opera特有のものではありません。 – Shelly