你好,我有一些影像,當點擊打開新視窗時。當我將其添加到 html 和 css 時,它們會從 hotizontal 變為混亂的垂直:
<div class="fade-in-image">
.fade-in-image {
opacity: 50%;
}
.fade-in-image:hover {
opacity:100%;
transition:opacity 2s
}
我嘗試分別添加到html和css:
<div class="myImg">
.myImg{
text-align:center;
}
但它沒有用,我認為我的 css 中其他地方的某些東西把它從整個 wesbite 中弄亂了。以下是我的鏈接:
<p>
<a href="https://twitter.com/" target="_blank" rel="noopener noreferrer"><img src="images/twitter.jpg" alt="twitter link" width="110px" height="110px"></a>
<a href="mailto:?subject=Hello&body=hello"><img src="images/google.jpg" alt="gmail link" width="110px" height="110px"></a>
<a href="https://www.twitch.tv/" target="_blank" rel="noopener noreferrer"><img src="images/twitch.jpg" alt="twitch link" width="110px" height="110px"></a>
</p>
感謝您的任何建議,如果需要,我將發布所有網站 css
uj5u.com熱心網友回復:
這是你想要做的嗎?
a>img {
opacity: 50%;
transition: opacity 2s
}
a>img:hover {
opacity: 100%;
}
<p>
<a href="https://twitter.com/" target="_blank" rel="noopener noreferrer"><img src="https://picsum.photos/200/300" alt="twitter link" width="110px" height="110px"></a>
<a href="mailto:?subject=Hello&body=hello"><img src="https://picsum.photos/200/300" alt="gmail link" width="110px" height="110px"></a>
<a href="https://www.twitch.tv/" target="_blank" rel="noopener noreferrer"><img src="https://picsum.photos/200/300" alt="twitch link" width="110px" height="110px"></a>
</p>
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/468660.html
