Code
Code is used for styling inline and multiline code snippets.
Inline code
For inline code, you can use the <code>
element.
<!-- inline code -->
<code>code</code>
Code snippet
For multiline code snippet blocks, you can use <pre>
with the code
class as a container, and add <code> inside it.
The data-lang
attribute is rendered as the language name in the top right.
<!-- code snippets -->
<button class="btn">
Submit
</button>
<pre class="code" data-lang="HTML"><code><span class="com"><!-- code snippets --></span>
<<span class="tag">button</span> <span class="atn">class</span>=<span class="atv">"btn"</span>>
Submit
<<span class="tag">/button</span>>
</code></pre>