fixed padding calculation

fixed padding calculation for firefox and IE