I have an html element that is contained within a div. Height are dictated by the outer div and the height and width of the input control are 100%. At the most basic level,
I'm assuming that you want the contained element ( You can either: An html-element's width is calculated (I think) as the defined width + borders + margin + padding If you've already defined the input as having 100% width of the parent, and then the other attributes are added it will definitely overflow the parent div. You can set the margin/padding/borders to 0, but that would likely not look good. So it's easier, though not necessarily perfect, just to use a suitably-smaller width. You could, of course, use to hide the portion of the input element that would normally overflow the container div.) to be smaller than, or contained entirely within, the
input {width: 50%; /* or whatever */ }
#parent_div {overflow: hidden; /* or 'auto' or whatever */}