Could you post a URL for us.
Maybe a little bit misleading there. The width property value applies to the content area of the W3c box, so if you have borders, padding or margins applied to the child element it will reduce the child content area width to allow the margin edges of the element to fit inside the parent element's padding edges.Bare in mind, the div element is a block element. Meaning it will span the width of its parent by default when its position is "static" or "relative" and adjust for any padding, margins or borders you apply (without having a width value declared).
Not quite right, absolute and fixed positioned block elements will take their width from the padding edges the nearest positioned ancestor if the element's width property is undefined or set to auto.It is only when you change the position to "absolute" or "fixed" that a defined will be required to have the element span the width of its parent, and it is then that you will need to consider the space taken by padding, margins and borders (as stated by Phraddee).
If the element has 'position: absolute', the containing block is established by the nearest ancestor with a 'position' of 'absolute', 'relative' or 'fixed', in the following way:
In the case that the ancestor is an inline element, the containing block is the bounding box around the padding boxes of the first and the last inline boxes generated for that element. In CSS 2.1, if the inline element is split across multiple lines, the containing block is undefined.
Otherwise, the containing block is formed by the padding edge of the ancestor.
If there is no such ancestor, the containing block is the initial containing block.
box model = margin + border + padding + WIDTH + padding + border + margin
so a div set at 200px with padding of 20px margin of 20px and a border of 5px would be 290px (20+5+20+200+20+5+20)
the same is true with % so if you've set a width to 100% and then add padding and or margins and or borders it will thus be larger that 100%, which either breaks out of its parent container or wraps.