These are my first steps with flex and I have the following code:
body {
box-sizing: border-box;
margin: 0;
padding: 0;
font-size: 14px;
}
.flexbox {
display: flex;
width: 100%;
max-width: 1241px;
height: 30px;
}
label {
flex-basis: 0;
flex-grow: 5;
background-color: cyan;
}
input {
flex-basis: 0;
flex-grow: 13;
background-color: yellow;
margin: 0;
padding: 0;
border: 0;
}
div {
flex-basis: 0;
flex-grow: 6;
height: 10px;
background-color: red;
}
<div class="flexbox">
<label>width must = 258.54px</label>
<input type="text" value="width must = 672.20px">
<div>width must = 310.25px</div>
</div>
Everything works as expected. However, I need to add to my input padding-left: 25px and as only I do it all sizes of the elements inside flexbox change. How can I add this padding and at the same keep the sizes (I mean using my solution with flex-grow and flex-basis)?
This is what I have with padding:0:
This is what I have when I add padding-left: 25px:

