<html> <head> <style type="text/css"> input { position:absolute; } </style> <script type="text/javascript"> function setTopEdge() { document.getElementById("b1").style.top="100px"; } </script> </head> <body> <input type="button" id="b1" onclick="setTopEdge()" value="Set top edge to 100 px" /> </body> </html>
结果:
编辑上面的代码,点击查看结果。
yige.org
- 试一个