CSS with Javascript

Discussion in 'CSS Forum' started by swarmy, Apr 10, 2013.

  1. swarmy

    swarmy New Member

    I would like to do something like this, but it's doesn't work\[code\] window.onresize = center; function center() { var x=window.innerWidth; x = x/2; document.getElementById("center_div").style.marginLeft = x; }\[/code\]How can I do it?
     

Share This Page