0
I have a input
and would like to put a box-sizing
'cause I’m gonna use padding-left
and would not like to touch the width of the element.
My HTML:
<div class="contato">
<form>
<input type="text" />
</form>
</div>
My CSS:
.contato input {
width: 480px;
height: 50px;
background-color: #e9e9e9;
padding-left: 15px;
box-sizing: padding-box;
}
The box-sizing
is not working as per image:
Is not the
box-sizing: border-box;
what do you want to use? thepadding-box
is not yet supported by almost any browser...– Sergio
I didn’t know. It’s the
padding-box
even, as I would like the 15px of padding not to be added to the width of the element.– Felipe Viero Goulart
In this case it is the same as the
border-box
. Give a look here I think the behavior/description with the padding is the same.– Sergio
If adding an image to the problem would be good, in case I’m not quite understanding the problem...
– Sergio
Ahh, you already clarified my doubt, I did not know that the
border-box
would suit my need. Thank you very much.– Felipe Viero Goulart