Is there any way to emulate the display of a pre element via CSS?
For example, can I keep the whitespace intact in this div by using a CSS rule?
<div class="preformatted">
Please procure the following items:
- Soup
- Jam
- Hyphens
- Cantaloupe
</div>
Use
white-space: preto preserve whitespace preformatting as in thepreelement. To go a step further, also addfont-family: monospace, aspreelements are typically set in a monospace font by default (e.g. for use with code blocks).