The Complete Usage of the White-space CSS Selector

What the heck is this white-space thing and where the heck am I supposed to use it? Why do we need something like this in our CSS? If you’ve ever wondered where, what and hows of the white-space selector, here’s your chance to get some learning in. This article takes you step by step through the complete usage of this handy-dandy little selector to bring your skill level all the way up to 11. Here’s a little sample:

Value: pre

The value pre works exactly as you would expect: The same as content wrapped inside <pre> tags. All spaces and line breaks are honored, creating output in the browser that is virtually identical to what is in the markup. Also, just like the <pre> tag, if everything in the markup is on a single line, the line will push the boundaries of its parent to keep everything in the output on a single line.

white-space: pre

Want more? The full article can be found here:

The CSS white-space Property Explained

What clever uses have you come up with for the white-space selector? Be sure to let us know below!

 

 

 

Cheers!
-Matthew Vazquez

Leave a Reply

Your email address will not be published. Required fields are marked *