【发布时间】:2015-11-12 08:46:01
【问题描述】:
代码
<!DOCTYPE html>
<html>
<head>
<title>Google Maps</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<style type="text/css">
#button {
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
height: 30px;
width: 200px;
left: 50%;
top: 50%;
position: absolute;
}
</style>
</head>
<body>
<input type="button" id="button" value="Open Map" />
</body>
</html>
我不确定如何正确地将按钮完全居中在页面中间。我尝试使用 left 和 top 50%;但这并不能完美地将按钮置于页面中间。谢谢。
这是下面附加的演示工作代码。
【问题讨论】: