解决措施:使用center或者div的align属性
示例代码:
<html>
<body>
<center><button onClick="clickme()">hit me</button></center>
<script>
function clickme(){
alert("123");
}
</script>
</body>
</html>
或者
<html>
<body>
<div align="center"><button onClick="clickme()">hit me</button></div>
<script>
function clickme(){
alert("123");
}
</script>
</body>
</html>
效果图: