JSFiddle - React, Tailwind, and code Playground
HTML
<div class='container'>
<div class='good-border'>
Hover here ...
<br/>
Good border!
</div>
<br/>
<div class='bad-border'>
Hover here ...
Bad border!
</div>
</div>
CSS
.good-border {
padding: 1px;
}
.good-border:hover {
padding: 0px;
border: 1px solid blue;
}
.bad-border:hover {
border: 1px solid blue;
}
.container {
border: 1px solid red;
width: 200px;
height: 150px;
}
.bad-border, .good-border {
background-color: red;
color: white;
width: 100px;
height: 50px;
cursor: pointer;
}