3
It’s a very simple question, but I couldn’t find an answer...
I have an element that has a borda
of 1px
. But when I make one :hover
on it I apply a transform:scale()
but the width of borda
him tb seems to increase, until I tried to put 0.01px
, but it didn’t work out.
Has some way to fix it without having to create a pseudo-element?
body {
margin: 2rem;
}
.box {
float: left;
width: 100px;
height: 100px;
border: 1px solid #000;
margin-right: 1rem;
transition: transform 500ms;
}
.box:hover {
transform: scale(2) translate(25%, 25%);
border: 0.1px solid #000;
}
<div class="box"></div>
If the element has a text, it should be affected by
scale
?– Woss
@Andersoncarloswoss not necessarily, which is bothering me even the edge growing along with the element, because the internal content of the div I already imagined would grow together
– hugocsl