Bootstrap Monospace and Code Styling
Bootstrap applies clear default styles to HTML code elements, making it easy to present inline code, blocks of code, keyboard shortcuts, and sample output in documentation and tutorial sites.
Inline Code
Wrap inline code in <code> — Bootstrap styles it with a monospace font, light red color, and a subtle background.
Code Blocks
For multi-line code, wrap a <code> inside a <pre> element. The .pre-scrollable class adds a max-height with scroll for long blocks.
Keyboard and Variables
<kbd> renders keyboard shortcuts in a dark badge style. <var> renders variable names in italic. <samp> renders sample output.