我有一個透明度爲div的div,我需要在透明度上放置一個鏈接,但純色或鏈接似乎都不起作用,我一直在嘗試不同的事情,比如把鏈接放在一個div裏,甚至使圖像變得可愛,只是在頂部添加文本,但是我不能讓它工作。 有什麼想法?在背景圖片上添加透明div上的鏈接
.skewed {
background-size: contain;
background-repeat: no-repeat;
color: white;
-webkit-clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%);
clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%);
width: 100%;
max-width: 400px;
min-width: 300px;
height: 350px;
min-height: 300px;
float: left;
margin-top: 5%;
}
.skewed:after {
content: '';
position: absolute;
width: inherit;
height: inherit;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.5);
}
.skewed a {
padding: 50%;
color: white;
font-size: 5em;
}
<div class="row">
<div class="col-sm-4 skewed" style="background-image: url(https://www.smashingmagazine.com/wp-content/uploads/2015/06/10-dithering-opt.jpg);">
<a href="" class="link">link</a>
</div>
</div>
太感謝你了,這個完美工作:d –