[
这里发生的情况是,当我单击特定缩略图时,它上面会出现勾号。它基本上是输入字段的标签。我怎样才能复制这样的东西?我需要的是当我点击一个特定的鞋子缩略图时,它的右上角会出现一个勾号,表示它已被选中。
我从源代码中提取了 HTML 标记。这里使用了 SVG,但我需要将其用作输入字段的标签。这是 HTML 的样子:
<div class="variation">
<div class="tick_icon">
<svg class="gl-icon">
<use xlink:href="#checkmark">
<symbol id="checkmark" viewBox="0 0 19 19">
<path fill="none" stroke="currentColor" stroke-linecap="square" stroke-miterlimit="10" d="M2.5 10.5l4 4 10-10">
</path>
</symbol>
</use>
</svg>
</div>
<div class="image_holder" style="background-image: url('url_here.com');">
</div>
</div>
相同的CSS在这里:
.variation{
max-width: 70px;
margin: 0 10px 10px 0;
display: block;
position: relative;
height: 70px;
}
.tick_icon{
border-radius: 50%;
background-color: #000;
position: absolute;
right: 0;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
}
.gl_icon{
height: 19px;
width: 19px;
display: inline-block;
color: #fff;
}
我自己的代码(简化)是这样设置的:
<input>
<label style="border;1px solid black;border-radius:50%">
<i style="background-image:url('image-url-here');border-radius:50%"></i>
</label>
所以,本质上,我需要切换我的标签 CSS 以使其看起来像一个勾号。
这是我的输出的样子: