###前提・実現したいこと
CSSを使って複数のリンク付きの画像をフェードイン・アウトで表示したいです。
###発生している問題・エラーメッセージ
複数の画像のフェードイン・アウト表示は出来ているが、<a href>で画像にリンクを付けようとすると複数の画像が同時に表示されてしまいます。
###該当のソースコード
<head> <STYLE type="text/css"> <!-- .Class{ color : white; } .stylename{ color : white; } --> <!-- a { text-decoration:none; } a:link, a:visited { color:white; } --> <!-- .photo-show { height: 440px; margin: 30px auto; max-width: 100%; position: relative; width: 900px; } .photo-show img { animation: show 21s infinite; -webkit-animation: show 21s infinite; height: auto; max-width: 100%; opacity: 0; position: absolute; } /*アニメーション*/ @keyframes show { 0% {opacity:0} 10% {opacity:1} 20% {opacity:1} 30% {opacity:0} } } .photo-show img:nth-of-type(1) { animation-delay: 0s; } .photo-show img:nth-of-type(2) { animation-delay: 7s; } .photo-show img:nth-of-type(3) { animation-delay: 14s; } --> </STYLE> </head> <body> <div class="photo-show"> <a href="html1.html"><img src="img/img1.jpg"></a> <a href="html2.html"><img src="img/img2.jpg"></a> <a href="http://example.jp/"><img src="img/img3.img"></a> </div> </body> </html>
###試したこと
フェードイン・アウトの時間を変えたり、画像の表示場所を変えたりしました。
###補足情報(言語/FW/ツール等のバージョンなど)
html
質問文のコードはコードブロックで囲んでいただけませんか? ```(バッククオート3つ)で囲み、前後に改行をいれるか、コードを選択して「<code>」ボタンを押すとコードブロックになります。また、例示用ドメインはご自身で所有されていない限り example.com, example.jp, example.co.jp など例示用に予約されたドメイン名を利用してください。 http://www.atmarkit.co.jp/fwin2k/win2ktips/801exampledom/exampledom.html
ご指摘の通り、コードを```で囲み、例示用ドメインをexample.jpへ変更いたしました。
回答2件
あなたの回答
tips
プレビュー