1
這是我到目前爲止已經試過:如何讓我的圖像水平顯示,並且都有覆蓋圖?
HTML:
<div class="container">
<a href="Game%20Page.htm" title="Game Page">
<img src="Images/green-circle-hi.png" alt="Green" class="image 1" style="width: 400px": height="400px"></a>
<div class="overlay">
</div>
<img src="Images/amber-clipart-face-15.png" alt="Amber" class="image 2" style="width: 400px": height="400px">
<div class="AmberOverlay">
</div>
</div>
CSS:
.container {
position: relative;
width: 28%;
}
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
transition: .5s ease;
background-image: url(Images/Green%20circle%20Overlay.jpg);
background-size: cover;
border-radius: 50%;
}
.container:hover .overlay {
opacity: 1;
}
.container {
position:absolute;
width: 28%;
}
.AmberOverlay {
position:absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
transition: .5s ease;
background-image: url(Images/Green%20circle%20Overlay.jpg);
background-size: cover;
border-radius: 50%;
}
.Amber:hover .AmberOverlay {
opacity: 1;
}
我想要得到的圖像在同一水平線上,並有一個單獨的覆蓋他們所有人,我如何更改或添加到此代碼,使之發生?
是的!這已經奏效了,謝謝。現在我將如何在兩幅圖像之間獲得更多的差距? – MarcusM900
爲了獲得差距,只需在邊緣添加「邊距」至周圍的框。即:'.box的{保證金:10px的;}'請接受的答案,如果它幫助你(和+1吧) – Nayish
真棒,還有一兩件事,我怎麼才能覆蓋要到另一個頁面的鏈接? – MarcusM900