【问题标题】:How to link customized bootstrap into index.html file?如何将自定义引导程序链接到 index.html 文件?
【发布时间】:2018-02-02 07:19:39
【问题描述】:

我是 bootstrap 新手(刚开始学习),我最近在 http://getbootstrap.com/docs/3.3/customize/ 上自定义了我的 bootstrap 文件

我编译并下载了,然后我发现很难将它与我的 index.html 文件链接。引导文件的来源在本地驱动器上,在我的代码中它看起来像这样

<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="desc">
    <meta name="keywords" content="content">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" >
    <link rel="stylesheet" href="css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">    

    <title>TITLE</title>
  </head>
  <body>    

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->     
    <script src="js/bootstrap.min.js"/> 
  </body>
</html>

请帮忙:)

【问题讨论】:

  • 难以链接是什么意思?您的自定义样式表将在您的head 中低于引导程序。

标签: html css twitter-bootstrap-3 customization


【解决方案1】:

如果您是 Bootstrap 新手,您应该首先使用最新版本(即 Bootstrap 4.0)。

启动项目的一个好方法是使用 CDN,Bootstrap 文件托管在远程服务器中,因此您不必在本地管理 Bootstrap 文件。 https://getbootstrap.com/docs/4.0/getting-started/download/#bootstrapcdn

检查浏览器中的控制台以确保所有内容均已正确加载。

要包含您的自定义 css,只需像处理任何 html 页面一样将 css 放在头部。

<head>
    <link rel="stylesheet" type="text/css" href="custom_main.css">
</head>

【讨论】:

    猜你喜欢
    • 2017-01-25
    • 2014-05-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-11
    • 2020-09-04
    • 2018-12-03
    相关资源
    最近更新 更多