简体   繁体   English

“手风琴”类在本地 Bootstrap 5 中无法识别

[英]"Accordion" class unrecognized in local Bootstrap 5

I am following the Bootstrap 5 docs to create a vertically collapsing Accordion, as detailed at https://getbootstrap.com/docs/5.0/components/accordion/我正在按照 Bootstrap 5 文档创建一个垂直折叠的手风琴,详细信息请参见 https://getbootstrap.com/docs/5.0/components/accordion/

However, despite having installed this library with libman, the main class "Accordion" throws an editor warning in Visual Studio 2019: "Unknown CSS class: 'accordion'".然而,尽管使用 libman 安装了这个库,主类“手风琴”在 Visual Studio 2019 中引发了一个编辑器警告:“未知的 CSS 类:'accordion'”。

This is the only class in BS5 with which I'm seeing this issue.这是 BS5 中唯一一个我看到此问题的课程。

If you know why this might be, I'd appreciate the help.如果您知道为什么会这样,我将不胜感激。

Apparently that is because it is not actually used as a CSS class by Bootstrap.显然这是因为 Bootstrap 实际上并未将其用作 CSS 类。 If you search the CDN source code you will not find ".accordion " (w/ space after) but there will be 31 instances of .accordion-* for the child-element styles.如果您搜索CDN 源代码,您将找不到".accordion " (后面有空格),但将有 31 个.accordion-*实例用于子元素样式。
I also searched the bootstrap.js and "accordion" does not occur anywhere in the file.我还搜索了 bootstrap.js,文件中的任何地方都没有出现"accordion" You can also inspect the example on the docs page and see no rules for the class, and removing the class has no affect.您还可以检查文档页面上的示例,看不到该类的规则,并且删除该类没有任何影响。 Therefore, it would appear that its use is purely just for convenience if you want override something.因此,如果您想覆盖某些内容,它的使用似乎只是为了方便。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM