I have an element within another element. The parent is of a certain size. I want the child to be the exact same size, but at the same time have a padding.
If I don’t know the exact size of the parent, is there any way to get it to be the same size as the parent and have a padding?
problem:
Thanks.
On supported browsers, set
box-sizingtoborder-box(CSS3 only). This causes the browser to calculate the width of an element as content + padding + border + margin (as opposed tocontent-boxin the CSS1/2 box model):I believe inputs already have this setting by default, but this can also apply to any other child elements whose widths you want calculated like that.