Some of the styles introduced by Angular4 into bootstrap do not take effect.

the current situation is that the grid is in effect, the background bar is not valid, and so on. What"s the problem?
this is not another unanswered question, is it

Target style:

:

1.app.component.html

<app-navbar></app-navbar>

<div class="container">
  <div class="row">
    <div class="col-md-3">
      <app-search></app-search>
    </div>
    <div class="col-md-9">
      <div class="row">
        <app-carousel></app-carousel>
      </div>
      <div class="row">
        <app-product></app-product>
      </div>
    </div>
  </div>
</div>

<app-footer></app-footer>

2.navbar.component.html

<nav class="navbar navbar-inverse navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <a class="navbar-brand" href="-sharp"></a>
    </div>
  </div>
</nav>

3.angular-cli.json

      "styles": [
        "styles.css",
        "../node_modules/bootstrap/dist/css/bootstrap.css"
      ],
      "scripts": ["../node_modules/jquery/dist/jquery.js",
                  "../node_modules/bootstrap/dist/js/bootstrap.js"
                ],

4.packge.json


    "bootstrap": "^4.0.0",
    "jquery": "^3.3.1",
Mar.01,2021

Don't look at bootstrap4 Chinese website, the above is inconsistent with the latest bootstrap, so you may have written outdated code (your library should be up to date)
to see the original bootstrap official website

Menu