0
我將頁面設置爲三列圖像,並將懸停覆蓋圖添加到它們中。我試圖在主圖像上添加一個額外的覆蓋圖,基本上是一個透明的png,但在懸停覆蓋之前。將覆蓋圖添加到懸停圖像
這是我的代碼,我有問題搞清楚了。
小提琴:http://jsfiddle.net/r4mp0v4v/
.wrapper img{
float:left;
width:100%;
}
@media screen and (min-width: 700px) {
.wrapper img{
width:33%;
height:100%;
}
}
body {
display: block;
margin: 0px;
}
img:hover{
opacity: 1;
}
img {
opacity: 0.5;
background: #000;
}
overlay_image{
position: absolute;
top: 60px;
left: 80px;
}
<div class="wrapper">
<a href="Northside.html">
<img src="https://upload.wikimedia.org/wikipedia/commons/6/6d/Good_Food_Display_-_NCI_Visuals_Online.jpg" alt="">
<img src="http://creativitywindow.com/wp-content/uploads/2013/02/PNG-Portable-Network-Graphics.png" class="overlay_image">
</a>
</div>
<div class="wrapper">
<a href="Catering.html">
<img src="https://upload.wikimedia.org/wikipedia/commons/6/64/Foods_(cropped).jpg" alt="">
</a>
</div>
<div class="wrapper">
<a href="test/index.html">
<img src="http://www.healthsguardian.com/wp-content/uploads/2015/05/Improper-time-to-have-some-foods.jpg" alt="">
</a>
</div>
嗯..試圖讓覆蓋png在整個不透明覆蓋層中保持可見。如果我能解決這個問題,還可以使用文本... – damann