Code
Notes on Implementation
We use Bootstrap’s Code implementation. The documentation for Bootstrap Code is applicable.
Accessibility Notes
Be sure to use a text color for the code display that has good color contrast with the surrounding body text. Darker code colors will get lost and be hard for visual users to easily identify.
Examples
Inline Code
Wrap inline snippets of code with <code>
. Be sure to escape HTML angle brackets.
For example, <section>
should be wrapped as inline.
Code Block
Use <pre>
s for multiple lines of code. You may add the .pre-scrollable
class, which will set a max-height of 340px and provide a y-axis scrollbar.
<p>Sample text here...</p>
<p>And another line of sample text here...</p>
Variables
Use the <var>
tag to indicate variables.
y = mx + b
User Input and Output
To switch directories, type cd followed by the name of the directory.
To edit settings, press ctrl + ,
This text is meant to be treated as sample output from a computer program.