After reading some comments, another solution is presented here using the skew transform , and when you hover it changes to a rectangle .
UPDATE
I added another form that was changed to cirlce
body {
background:#f2f2f5;
}
.pointer {
width: 200px;
height: 40px;
position: relative;
margin: 20px;
transition: 0.5s;
}
.pointer:before {
content: "";
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 50%;
border: 1px solid red;
border-bottom: 0;
transform: skew(35deg);
transition: 0.5s;
}
.pointer:after {
content: "";
position: absolute;
top: 50%;
right: 0;
left: 0;
bottom: 0;
border: 1px solid red;
border-top: 0;
transform: skew(-35deg);
transition: 0.5s;
}
.pointer:hover::after,
.pointer:hover::before {
transform: skew(0deg);
}
.to-cirlce {
border: 1px solid transparent;
}
.to-cirlce:hover {
width: 80px;
height: 80px;
border: 1px solid red;
border-radius: 50%;
}
.to-cirlce:hover::after,
.to-cirlce:hover::before {
border: none
}
<div class="pointer">
</div>
<div class="pointer to-cirlce">
</div>
Run codeHide result source
share