Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

div padding trouble

0 views
Skip to first unread message

Frank Salem

unread,
Jul 14, 2008, 4:30:53 AM7/14/08
to

Hello Guys,

Can someone make this work?

mainDiv.style.paddingTop=Math.round(bodyDiv.offsetWidth*0.5)+"px solid
#E8F1E7";
mainDiv.style.paddingLeft=Math.round(bodyDiv.offsetWidth*0.5)+"px solid
#E8F1E7";
mainDiv.style.paddingRight=Math.round(bodyDiv.offsetWidth*0.5)+"px solid
#E8F1E7";

I was trying to make padding of the mainDiv but this one displays an
error!

Thanks in advance!


Martin Honnen

unread,
Jul 14, 2008, 9:34:24 AM7/14/08
to
Frank Salem wrote:

> Can someone make this work?
>
> mainDiv.style.paddingTop=Math.round(bodyDiv.offsetWidth*0.5)+"px solid
> #E8F1E7";

See http://www.w3.org/TR/CSS21/box.html#padding-properties, you need to
assign a length only but no style (no solid) and no color (no #E8F1E7):
mainDiv.style.paddingTop=Math.round(bodyDiv.offsetWidth*0.5)+"px";
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

0 new messages