Comments on: white-space https://css-tricks.com Tips, Tricks, and Techniques on using Cascading Style Sheets. Wed, 28 Sep 2022 17:15:38 +0000 hourly 1 https://wordpress.org/?v=6.1.1 By: GWB https://css-tricks.com/almanac/properties/w/whitespace/#comment-1751746 Wed, 02 Oct 2019 00:29:27 +0000 http://css-tricks.com/?page_id=14136#comment-1751746 These don’t seem to work inside table cells.
I have some data with “/”s and an “&” between words (not all of the data, just some elements of it). When the information is placed in table cells (th or td), without any other formatting, it reads right on out of the cell (obscuring other information and basically looking awful).
When I apply word-break: break-all it breaks when it runs out of space, but not at a logical point:
Open/P
ath
I have added a space before and after the “/”, but it treats all of it as whitespace, it seems, and reduces it to just “/”. (It looks identical to the above.)
If I use white-space: pre-wrap, it just returns it to the state of running on and out of the cell and looking awful. On top of that, it doesn’t even preserve the whitespace!

What am I missing?

]]>
By: Maurice Head https://css-tricks.com/almanac/properties/w/whitespace/#comment-1612840 Sat, 04 Nov 2017 10:06:48 +0000 http://css-tricks.com/?page_id=14136#comment-1612840 I have a long sentence which wraps ok, but it hyphenates words; how can I prevent this?

]]>
By: Andrew K. https://css-tricks.com/almanac/properties/w/whitespace/#comment-1610602 Mon, 24 Jul 2017 18:25:36 +0000 http://css-tricks.com/?page_id=14136#comment-1610602 THANK YOU SO MUCH! This is exactly what I was looking for. At first I tried using

tags to enclose the text retrieved from my SQL database. Then I had a new problem because the text wasn’t formatted with the proper font. Then I tried inline styling with style=”white-space: pre”. Then I had a new problem because the text wouldn’t wrap. FINALLY, I found your blog and tried style=”white-space: pre-wrap”, which saved my life. Thanks for your simple tutorial/explanation.

]]>
By: Scott https://css-tricks.com/almanac/properties/w/whitespace/#comment-1605871 Sat, 31 Dec 2016 13:46:47 +0000 http://css-tricks.com/?page_id=14136#comment-1605871 test

]]>
By: Adam Beck https://css-tricks.com/almanac/properties/w/whitespace/#comment-1605484 Thu, 08 Dec 2016 16:28:50 +0000 http://css-tricks.com/?page_id=14136#comment-1605484 Sorry, I cannot edit. I also originally tried this on codepen: http://codepen.io/adam-beck/pen/oYyEOd. For some reason it still doesn’t add a blank line after even though there is a line break in the HTML.

]]>
By: Adam Beck https://css-tricks.com/almanac/properties/w/whitespace/#comment-1605483 Thu, 08 Dec 2016 16:27:43 +0000 http://css-tricks.com/?page_id=14136#comment-1605483 Can anybody explain the behavior I’m seeing? I have followed along with this article and it makes sense that there are 2 line breaks in the HTML and why the sample using white-space: pre is showing a blank line both before and after the text. However, when I try doing this I am only seeing an empty line above the text.

<div>
   A bunch of words you see.
</div>
div {
  width: 100px;
  border: 1px dotted red;
  white-space: pre;
}

Here is my fiddle: https://jsfiddle.net/2wm7v5pc/

]]>
By: trgfds https://css-tricks.com/almanac/properties/w/whitespace/#comment-1605337 Thu, 01 Dec 2016 08:06:50 +0000 http://css-tricks.com/?page_id=14136#comment-1605337 In reply to swordenium.

asdasdasdasdf

]]>
By: trgfds https://css-tricks.com/almanac/properties/w/whitespace/#comment-1605336 Thu, 01 Dec 2016 08:05:19 +0000 http://css-tricks.com/?page_id=14136#comment-1605336 In reply to swordenium.

wefrgthyjuk

]]>
By: Jon https://css-tricks.com/almanac/properties/w/whitespace/#comment-1601095 Fri, 22 Apr 2016 12:30:09 +0000 http://css-tricks.com/?page_id=14136#comment-1601095 Man I can’t tell you how many times I look around the web for solutions or half solutions and not find the answer until I land on css-tricks. Thanks for being there all those times man. Keep it up.

]]>
By: Yann https://css-tricks.com/almanac/properties/w/whitespace/#comment-1586800 Wed, 19 Nov 2014 00:13:25 +0000 http://css-tricks.com/?page_id=14136#comment-1586800 Thanks! You make my day!

]]>
By: dexter_one https://css-tricks.com/almanac/properties/w/whitespace/#comment-1584878 Mon, 01 Sep 2014 22:07:36 +0000 http://css-tricks.com/?page_id=14136#comment-1584878 Good Job, very nice tip. Grettings from Mexico.

]]>
By: ty https://css-tricks.com/almanac/properties/w/whitespace/#comment-1582848 Wed, 18 Jun 2014 20:03:00 +0000 http://css-tricks.com/?page_id=14136#comment-1582848 In reply to sunyata.

I’m having the same problem with IE. white-space: pre-wrap does not work in IE9. Not sure about other IE versions. Works fine in Chrome. Any ideas how to get it to work in IE???

]]>
By: Ryan McKay https://css-tricks.com/almanac/properties/w/whitespace/#comment-1582755 Mon, 16 Jun 2014 23:17:26 +0000 http://css-tricks.com/?page_id=14136#comment-1582755 Anyone else having problems with white-space: pre?
When I use it on a textarea in Chrome 34.0.1847.137 the text still wraps…even though it says under “Text Wrapping” that it shouldn’t.
New lines, spaces, tabs etc all act as expected…but long lines are still wrapping :(

Could this be a behavior specific to only textareas?

]]>
By: Cee https://css-tricks.com/almanac/properties/w/whitespace/#comment-1581360 Mon, 19 May 2014 02:24:18 +0000 http://css-tricks.com/?page_id=14136#comment-1581360 Hi Folks,

I’m not geeky so please help. I’m using wordpress. When I press SPACEBAR twice after a fullstop, the second or (nth) row in a paragraph is being indented and not lining up to the left. This only happens when I press SPACEBAR twice (after previous sentence) towards the end of the previous line where the text is forced to wrap onto second line. Am I missing something from my CSS sheet?

]]>
By: Adam Steel https://css-tricks.com/almanac/properties/w/whitespace/#comment-1581259 Thu, 15 May 2014 20:09:07 +0000 http://css-tricks.com/?page_id=14136#comment-1581259 I just love this site. It seems like I end up here three times a week, finding good answers to issues I have. Thank you, and keep up the good work.

]]>