如何在 IntelliJ IDE 中添加 bootstrap 自动代码完成功能?

how can I add bootstrap auto code completion feature in IntelliJ IDE?

我在我的 IntelliJ IDEA 中添加了 Bootstrap3 插件,还在 html 页面中添加了 css 和 js 链接。但是我无法获得 bootstrap class 名称等的自动完成。 我怎样才能做到这一点?

我遇到了同样的问题并最终找到了这个:https://intellij-support.jetbrains.com/hc/en-us/community/posts/206324479-How-to-activate-autocomplete-with-Bootstrap

技巧是您不能使用交付的 cdn css - 您必须在本地引用它。

这条线对我有用(html 文件在 .../resources/templates/ 和 bootstrap .css 文件下载到 .../resources/static):

<link rel="stylesheet" href="../static/bootstrap.css">

我确实需要稍等片刻,让 intellij 先将它编入索引。

希望对您有所帮助:)

首选项 |语言与框架 | JavaScript |图书馆 然后按“+” -> 附加文件 -> bootstrap.min.css -> OK