没有使用 Bootstrap for Angular 呈现的样式

Kon*_*ten 2 css sass twitter-bootstrap bootstrap-4 angular

我已经使用以下命令安装了NgbBootstrap 4。当然,根模块也会导入包。

npm install @ng-bootstrap/ng-bootstrap --save
npm install bootstrap@next --save

在代码中,我试图添加以下指令。然而,唯一呈现的是一个关闭十字按钮和我输入的文本,只是无聊 - 没有边框、框、颜色等。

<ngb-alert type="info">dsdsdds</ngb-alert>
Run Code Online (Sandbox Code Playgroud)

不确定如何进一步排除故障,因为 googlearching 没有产生任何影响。建议?

Kon*_*ten 5

The misleading part on the website for NgBootstrap's site is that they only have focused on the framework of directives, leaving out the styling all together to the developers.

So, basically put, it appears that the CSS and/or SCSS are still supposed to be provided by the coder. The solution is to design the styles by oneself or, which is the immensely wiser and undoubtedly quicker, to snatch them from the public distribution of Bootstrap using the following statement.

<link rel="stylesheet"
      href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" />
Run Code Online (Sandbox Code Playgroud)

  • @pkozlowski.opensource 我不是要告诉你们如何编写文档。毕竟,可能是我的草率背后没有足够正确和仔细地阅读。我只是说**对我来说**它不是“只有框架而不是颜色”,可以这么说。我认为我立即跳到了 *安装 * - 我的想法将依赖项的引用过滤为“包含在安装中”。另外 - 感谢伙伴的软件。我已经很享受使用它了。:) (3认同)
  • 对。您必须自己包含引导 css 文件。如果您使用 angular cli,请考虑将 bootstrap 4 作为依赖项并将其包含到您的 angular-cli.json 中 (2认同)