user1502301
user1502301

Reputation: 565

Word Wrap a Div, all on a single line

I have a string in a div: Test: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

Using a the word_wrap CSS class found on Stack Overflow,

/* Source: http://snipplr.com/view/10979/css-cross-browser-word-wrap */
.wordwrap { 
white-space: pre-wrap;      /* CSS3 */   
white-space: -moz-pre-wrap; /* Firefox */    
white-space: -pre-wrap;     /* Opera <7 */   
white-space: -o-pre-wrap;   /* Opera 7 */    
word-wrap: break-word;      /* IE */
}

it appears like this:

Test:
AAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAA

How can I wrap it so Test: and the A's are on the same line?

Upvotes: 0

Views: 163

Answers (1)

Scott Saunders
Scott Saunders

Reputation: 30394

Use a &nbsp; instead of a regular space:

Test:&nbsp;AAAAAAAAAAAAAAAAAAAA 

Upvotes: 2

Related Questions