How can I add an active class with a 5px border-bottom on a button without increasing the button size by 5px? The box-sizing property is not working for me. Is there a simple solution to achieve this?
*,
*:after,
*::before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.container {
width: 100%;
border: 2px solid blue;
}
.button {
background: black;
width: 150px;
border: 0;
padding: 20px;
margin: 0;
color: white;
}
.active {
border-bottom: 5px solid yellow;
}
<div class="container">
<button class="button active">button active</button>
<button class="button">button</button>
</div>