views:

25

answers:

3

I feel like there's a simple solution to this, but I'm not really sure how to phrase it in a search, so here we go...

I have a forum-like display that shows a block of text with a user image, user name, and time stamp appended to the end of the text. Many times, part of the appended section gets dropped to a new line. This is especially annoying when the time stamp (which usually displays "8:25 PM, Mar 4") comes out as something like "8:25" {new line} "PM, Mar 4".

Is there either a tag or a css-trick that would drop an entire section of text to a new line all at once if any part of that section needs to drop?

A: 

You can give that element a style: white-space: nowrap;

If you always want it to drop, then display: block; as well.

Nick Craver
A: 

And if you don't want it to drop, you can give n or more elements display: inline;.

Finbarr
A: 

There is also the entity   which represents a non breakable space.

Miquel