这是我第一次尝试 bootstrap。除了班级超大屏幕不工作外,一切似乎都已就绪。类容器工作并将内容置于中心,但假设提供一些背景的超大屏幕似乎不起作用。 (添加或删除类似 class="jumbotron" 的内容对页面没有影响。)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<link href="./css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="jumbotron">
<h1>My first Bootstrap website!</h1>
<p>This page will grow as we add more and more components from Bootstrap...</p>
</div>
<p>This is another paragraph.</p>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</div>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="./js/bootstrap.min.js"></script>
</body>
</html>
我附上ide的所以你可以看到我的文件树。我自己也检查过,似乎我已经正确加载了所有内容。
更新:重新下载引导程序使用完全相同的代码解决了问题。不知何故,我的第一次下载工作不正常。
尝试:
<script src="js/bootstrap.min.js"></script>
<link href="css/bootstrap.min.css" rel="stylesheet">
没有./代替。
或 CDN:
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
尝试使用
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
在你的 HTML 头中。
Jumborton 在 bootstrap 5 中已经过时,所以你不能使用它。相反,你必须制作你自己的 jumborton 版本。您可以使用以下代码:
<div class="mt-4 p-5 bg-primary text-white rounded">