[英]arrow hover adding a circle div behind
我有兩個箭頭圖像(上一個/下一個),這里的代碼如下:
.fp-controlArrow {
position: absolute;
width: 32px; /* This can be added here so you don't have to set a width and height 2 times for each arrow, this will create one width for both arrows */
height: 32px; /* This does the same as above */
margin-top:-15px; /* This value must always be half of the height - This does the same as above */
z-index: 30;
top: 50%;
cursor: pointer;
}
.fp-controlArrow.fp-prev {
left:0;
background: url(https://uploads-ssl.webflow.com/602dbecd2160ce28b5bc428b/602e923133f8dc0bf994fc49_left-arrow.svg) no-repeat;
}
.fp-controlArrow.fp-next {
right:0;
background: url(https://uploads-ssl.webflow.com/602dbecd2160ce28b5bc428b/602e9231ec03b6c9682b540c_right-arrow.svg) no-repeat;
我想當我 hover 在箭頭上時,它會在箭頭后面出現一個圓形透明圓圈,如下例所示:
我怎樣才能做到這一點?
謝謝你!
padding: 1em;
border-radius: 50%;
background-color: rgba(200,200,200,0.5)
將這些行添加到.fp-controlArrow
class 應該可以。
抱歉,我沒有意識到它是 svg。 您必須內聯 svg。
<div class="fp-controlArrow fp-prev">
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-reactroot="">
<path stroke-linejoin="round" stroke-linecap="round" stroke-width="1" stroke="#221b38" d="M16 20L8 12L16 4"></path>
</svg>
</div>
<div class="fp-controlArrow fp-next">
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-reactroot="">
<path stroke-linejoin="round" stroke-linecap="round" stroke-width="1" stroke="#221b38" d="M8 20L16 12L8 4"></path>
</svg>
</div>
.fp-controlArrow {
position: absolute;
width: 32px; /* This can be added here so you don't have to set a width and height 2 times for each arrow, this will create one width for both arrows */
height: 32px; /* This does the same as above */
margin-top:-15px; /* This value must always be half of the height - This does the same as above */
z-index: 30;
top: 50%;
cursor: pointer;
padding: 1em;
border-radius: 50%;
}
.fp-controlArrow:hover {
background: green;
background-color: rgba(200,200,200,0.5);
}
.fp-controlArrow.fp-prev {
left:0;
}
.fp-controlArrow.fp-next {
right:0;
這是一個演示它的代碼筆。
抱歉,我沒有看到:和 hover 之間的空格。
.fp-controlArrow.fp-prev {
left:0;
background: url(https://uploads-ssl.webflow.com/602dbecd2160ce28b5bc428b/602e923133f8dc0bf994fc49_left-arrow.svg) no-repeat;
border-radius: 50px;
}
.fp-controlArrow.fp-prev:hover{
background-color: #999999;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.