Sir/Madam:
Can someone help with this code below? I create two divs namely bodyDiv
and mainDiv. mainDiv
was appended to the bodyDiv. I set the same width for the two. Now, my
problem is that when I
add padding and border for the mainDiv, it got an unpleasant look The
mainDiv seems to react only
to the paddingTop and paddingLeft but not for the paddingRight, it was
being pushed to the right
of the mainDiv/bodyDiv. paddingRight seems to be not working. What
should I do with it? Should I adjust
also the width of the mainDiv because of padding and border?
Here's the code:
mainDiv.style.paddingTop=Math.round(bodyDiv.offsetWidth*0.010)+"px";
mainDiv.style.paddingLeft=Math.round(bodyDiv.offsetWidth*0.010)+"px";
mainDiv.style.paddingRight=Math.round(bodyDiv.offsetWidth*0.010)+"px";
mainDiv.style.border=Math.round(bodyDiv.offsetWidth*0.009)+"px solid
#000000";
mainDiv.style.width=Math.round(bodyDiv.offsetWidth)+"px";
This code work only IE6 but not on Firefox and IE7...
Please help!
Thanks in advance!!!