---
title: "💭 white-space - CSS: Cascading Style Sheets | MDN"
description: "!https://developer.mozilla.org/en-US/docs/Web/CSS/white-space"
date: 2024-04-30
published: true
tags:
  - html
  - webdev
  - thought
template: link
---


<div class="embed-card embed-card-external">
  <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/white-space" class="embed-card-link" target="_blank" rel="noopener noreferrer">
    <div class="embed-card-image">
      <img src="https://developer.mozilla.org/mdn-social-image.46ac2375.png" alt="white-space - CSS | MDN — The white-space CSS property sets how white space inside an element is handled." loading="lazy">
    </div>
    <div class="embed-card-content">
      <div class="embed-card-title">white-space - CSS | MDN</div>
      <div class="embed-card-description">The white-space CSS property sets how white space inside an element is handled.</div>
      <div class="embed-card-meta">MDN Web Docs &middot; developer.mozilla.org</div>
    </div>
  </a>
</div>


html can preserve newline `\n` characters by styling an element with `white-space: pre-wrap;`

> pre-wrap
    Sequences of white space are preserved. Lines are broken at newline characters, at <br>, and as necessary to fill line boxes.

!!! note

    This post is a <a href="/thoughts/" class="wikilink" data-title="Thoughts" data-description="These are generally my thoughts on a web page or some sort of url, except a rare few don&#39;t have a link. These are dual published off of my..." data-date="2024-04-01">thought</a>. It's a short note that I make
    about someone else's content online <a href="/tags/thoughts/" class="hashtag-tag" data-tag="thoughts" data-count=2 data-reading-time=3 data-reading-time-text="3 minutes">#thoughts</a>
