【发布时间】:2017-05-25 12:49:58
【问题描述】:
我正在使用 Bootstrap 构建个人网站,但遇到了一个我找不到解决方案的问题。我查看了各种教程,并且只有一个简单网页的基本骨架。但是,页面的左端似乎超出了屏幕的左边缘,将滚动条向右移动,使页面超出了 jumbotron 标题的边缘。
如何使页面在屏幕上居中?
这是我的完整代码:
<!DOCTYPE html>
<html>
<head>
<title>My Name</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
rel="stylesheet">
</head>
<body>
<div class="jumbotron text-center">
<h1>My Name</h1>
</div>
<div class="row">
<h2>What I've Been Up To</h2>
</div>
</body>
<footer>
<p> Copyright ©
<!--Script displays the current year-->
<script type="text/javascript">
var d = new Date()
document.write(d.getFullYear())
</script>
</p>
</footer>
</html>
【问题讨论】:
标签: html css twitter-bootstrap