首页 > 解决方案 > 如何包含样式表

问题描述

我开始用 HTML 和 CSS 编程。我有这行非常简单的代码,我尝试添加引导程序,但我无法使按钮具有样式表添加的样式。

所以按钮没有向我显示其各自的样式,所以我想知道我做错了什么?

<html>
<head>
    <script src="bootstrap.min.js"></script>
    <title>Name of the website</title>
</head>
<body>
    <p>This is an example of a paragraph.</p>
    <p>¡Hello world!</p>
    <button type="button" class="btn btn-danger">Danger daw!</button>
</body>
</html>

标签: htmlcssbootstrap-4

解决方案


 <!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h1>Maybe this way the code can help you</h1>
  <p>This is a example of paragrafh</p>
  <p>!Hello world!</p>
</div>

</body>
</html>


推荐阅读