如何在 bootstrap 中禁用 <pre> 的样式

How to disable styling on <pre> in bootstrap

我正在使用 HTML 的 <pre></pre> 将我的文本呈现为 \n 和块中的空格。但是 bootstrap 的默认行为是将 <pre> 块放在灰色背景的边框框中。我不想要那个。我希望它显示为纯文本。

如何禁用 pre 的样式行为?

你可以这样做:

pre {border: 0; background-color: transparent;}

检查此 Vanilla CSS Un-Reset 以获得其他属性的默认值。