Jump to content

 


RivkaS

Recommended Posts

Normally HTML will truncate spaces in your text. If you write 10 spaces in your text HTML will remove 9 of them. To add spaces to your text, use the   character entity.
  1. Could somebody please explain that in other words?
  2. Do I need to add this entity by my self or does that happen automatically?

Link to comment
Share on other sites

  1. Could somebody please explain that in other words?
  2. Do I need to add this entity by my self or does that happen automatically?

  1. If you write more then a single space between characters (letters, symbols), all of those spaces are reduced to a single space when the HTML file is displayed on the browser screen.For example, if you write:
    some		text

    (8 spaces originally. I'm not sure to how much the forum reduces them to)In an HTML file, on the browser screen you'll see

    some text

    (1 space)

  2. You need to add it in the HTML file yourself. Without it, space is reduced as shown above. With it, each occurance of & nbsp; will be another space to preserve. So, if you write
    some    	 text

    (8 spaces originally, and one & nbsp; between them)In an HTML file, on the screen you'll see

    some   text

    (3 spaces. One for all space between "some" and the entity, the entity itself, and one for all space between the entity and "text")

Link to comment
Share on other sites

  1. Could somebody please explain that in other words?
  2. Do I need to add this entity by my self or does that happen automatically?

You can't add spaces in code by just pressing the spacebar. HTML will remove the spaces and leave only one, any space after the first one is removed. In order to add spaces if you need them, would be to type   in. It is a space equivalent.I believe versions of Dreamweaver add that character, but im not sure, I just use it in code view. I believe in Design view it auto adds the   into your code.
Link to comment
Share on other sites

You can't add spaces in code by just pressing the spacebar.
So I need to insert this into code but not into text that is between tags, correct?
Link to comment
Share on other sites

some		 text

some   text

(3 spaces. One for all space between "some" and the entity, the entity itself, and one for all space between the entity and "text")

So a word is a space however long and "nbsp" is a space - but wouldn't that mean that I need to place a nbsp between every two words?
Link to comment
Share on other sites

So a word is a space however long and "nbsp" is a space - but wouldn't that mean that I need to place a nbsp between every two words?
No. If you have one space, it's shown as is (as space). It's just that if you have more then one space, it's reduced to one space. You only need to place this entity (nbsp) if you need to have more then one space between two words.
Link to comment
Share on other sites

You only need to place this entity (nbsp) if you need to have more then one space between two words.
Ahhhhhh... now I understand. Thank you so much :)
Link to comment
Share on other sites

It is also used to make sure that words are kept together and do not get split at the end of a line. So if you want (for example) to display the name Mr Smith but make sure Mr doesn't appear at the end of a line and Smith at the beginning of the next you would use a nbsp (non-breaking space).

<p>... blah ... blah ... blah ... Mr Smith ... blah ... etc</p>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...