我想为卡片创建边框,如下所示:
卡片悬停时的边框:
以下是我的代码示例:
<div class="apps-card">
<div class="card-body">
</div>
</div>
.apps-card {
height: 300px;
width: 250px;
position: relative;
overflow: hidden;
margin-left: 200px;
margin-top: 200px;
background: rgb(2,0,36);
background: linear-gradient(129.8deg, purple 50%, rgba(9,121,120,1) 50%);
.card-body {
position: absolute;
left: 4px;
right: 4px;
bottom: 4px;
top: 4px;
background-color: #fff;
}
}
但我注意到:如果我改变卡片的宽度-边框不适合卡片并且有错误的位置.如何创建响应边框或任何其他方式来创建边框,就像在图像中使用悬停变换一样?