HTML entitites - alternative to &nbsp?

html, html-entities

Solution

` ` is an alias for ` ` or `&xa0;`. This character is defined as "non-breaking space" in the HTML standard. So someone said "browser must treat this is a space but not break a line" in a standard and all people who created Web browsers adhered to this standard.

If your editor supports it, you can also type this character. The browser doesn't care how it was created, only that it sees the byte 0xa0 in the input stream.

As an alternative, you can use various CSS styles and tricks to create lengths of text that won't break (for example with the style `white-space: nowrap` (see here) or by using padding / margins.

Related:

- http://en.wikipedia.org/wiki/Non-breaking_space

Problem

I am a beginner with HTML (coming from a C background) and I came across the concept of HTML entities. I have some very basic questions regarding &nbsp. How does &nbsp entity introduce a non-breaking space within an element ? Is there any alternative to using the &nbsp entity in HTML ? My internet searches have not given the answer I was looking for and some direction on these would be most appreciated.

Original source

Related problems