You will need to understand the box model rule. See the box model here
. The box model says that whatever you put inside an element cannot be larger than that element. margin/padding/border all count when figuring width/height.
Also know that % widths and px margin/padding sometimes to not work well together.