Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
All-Star
42887 Points
7020 Posts
MVP
Apr 23, 2012 07:17 AM|LINK
tarekahf margin-left:expression(-this.clientWidth/2 + "px");
Hi,
Try this
document.getElementById('yourelementIdhere').style.marginLeft = (-parseInt(document.body.clientWidth)/2)+"px";
Please 'Mark as Answer' if this post helps you.
Ruchira
All-Star
42887 Points
7020 Posts
MVP
Re: CSS Error: is not a valid value for the 'margin-left' property.
Apr 23, 2012 07:17 AM|LINK
Hi,
Try this
document.getElementById('yourelementIdhere').style.marginLeft = (-parseInt(document.body.clientWidth)/2)+"px";
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.