Javascript examples for CSS Style Property:left
Using negative values to Set the left position of a <div> element:
<!DOCTYPE html> <html> <head> <style> #myDIV {/*from ww w . j a v a2 s . c om*/ position: absolute; width: 100px; height: 100px; background-color: coral; color: white; } </style> </head> <body> <button onclick="myFunction()">Test</button> <div id="myDIV"> <h1>myDIV</h1> </div> <script> function myFunction() { document.getElementById("myDIV").style.left = "-30px"; } </script> </body> </html>