Home » Questions » Computers [ Ask a new question ]

Preventing line breaks in HTML [closed]

Preventing line breaks in HTML [closed]

Is there any way to prevent a line break in HTML? For example, on one of my web pages the browser put a break after the comma in the number 43,560. I could remove the comma, but that makes the number harder to read.

Asked by: Guest | Views: 69
Total answers/comments: 1
Guest [Entry]

"You can use styles to ensure that the browser won't break lines there. CSS has a white-space property which does that. So

<span style=""white-space: nowrap;"">43,560</span>

should work.

If you need this more often, you should probably create a CSS class for that, though."