What you need is a "Non-Breaking Space", in actual HTML code, it is represented by In a WYSIWYG editor like dreamweaver, there is usually a key combination that will insert one for you, I think it is CTRL-SPACE.
Multiple spaces, line-ends, and tabs normally collapse to a single space in HTML. You can prevent that by using the PRE element, or by declaring "white-space: pre;" in CSS.
If you just want to increase word spacing in a group of words, use the "word-spacing" property in CSS for better control of the amount of space added.
Cordially, David
Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;
Why are you trying to insert an extra space? All of the above answers are good ones, but I'm thinking from a semantic perspective. What's the purpose of the nbsp? I don't really think there are a lot of reasons for using nbsp's but we might be able to think of some. If it's a presentational issue then it should be handled using CSS. If it's because you were taught to type with two spaces after a period, then you should try to unlearn that habit (it's a hold over from old typewriters and isn't necessary anymore).
David - does word-spacing actually work? I'm going to have to try that out... (I mean, is it supported by browsers)
It is supported Meg, the same properties as letter-spacing which I seem to use a lot lately... it's at Topic 16.4 here http://www.w3.org/TR/REC-CSS2/text.html
No, I mean does it actually work in web browsers? supported != part of the w3c spec. I know it's in the spec. Letter-spacing is in there too but isn't supported by browsers
Well I also mean supported in browsers as far as I remember, as in I use it all the time... I think my previous post wasn't clear enough... sorry bout that... The link was suppose to clarify you with it's property...
Letter-spacing works in IE 5.01 and up; Firefox 2, Opera 9, Netscape 7.2, and Moz 1.7.
Word-spacing works in the above except for IE 5.01 and IE 5.5.
Incidentally, I sometimes use a negative letter-spacing for headings. Depending on the font, it can give a nice effect. Letter-spacing: -1px; is usually enough.
Cordially, David.
Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;
That's a good idea, David! I'll have to try that sometime.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.
Greg K posted this at 01:48 — 24th May 2007.
He has: 2,145 posts
Joined: Nov 2003
What you need is a "Non-Breaking Space", in actual HTML code, it is represented by In a WYSIWYG editor like dreamweaver, there is usually a key combination that will insert one for you, I think it is CTRL-SPACE.
-Greg
webwiz posted this at 02:14 — 24th May 2007.
He has: 629 posts
Joined: May 2007
Multiple spaces, line-ends, and tabs normally collapse to a single space in HTML. You can prevent that by using the PRE element, or by declaring "white-space: pre;" in CSS.
If you just want to increase word spacing in a group of words, use the "word-spacing" property in CSS for better control of the amount of space added.
Cordially, David
Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;
kb posted this at 02:05 — 24th May 2007.
He has: 1,380 posts
Joined: Feb 2002
When you want a space you can do this:
<p>Here's some text...and some more. But NOW here's two spaces!</p>
The character is literally a space. Any number you want, just use the as a spacebar-hit.
Megan posted this at 13:15 — 24th May 2007.
She has: 11,421 posts
Joined: Jun 1999
Why are you trying to insert an extra space? All of the above answers are good ones, but I'm thinking from a semantic perspective. What's the purpose of the nbsp? I don't really think there are a lot of reasons for using nbsp's but we might be able to think of some. If it's a presentational issue then it should be handled using CSS. If it's because you were taught to type with two spaces after a period, then you should try to unlearn that habit (it's a hold over from old typewriters and isn't necessary anymore).
David - does word-spacing actually work? I'm going to have to try that out... (I mean, is it supported by browsers)
Megan
Connect with us on Facebook!
demonhale posted this at 01:22 — 25th May 2007.
He has: 3,278 posts
Joined: May 2005
It is supported Meg, the same properties as letter-spacing which I seem to use a lot lately... it's at Topic 16.4 here http://www.w3.org/TR/REC-CSS2/text.html
Megan posted this at 12:51 — 25th May 2007.
She has: 11,421 posts
Joined: Jun 1999
No, I mean does it actually work in web browsers? supported != part of the w3c spec. I know it's in the spec. Letter-spacing is in there too but isn't supported by browsers
Megan
Connect with us on Facebook!
Megan posted this at 13:22 — 25th May 2007.
She has: 11,421 posts
Joined: Jun 1999
Well surprise surpirse, they actually do work! And even in IE 6!
demonhale posted this at 02:18 — 26th May 2007.
He has: 3,278 posts
Joined: May 2005
Well I also mean supported in browsers as far as I remember, as in I use it all the time... I think my previous post wasn't clear enough... sorry bout that... The link was suppose to clarify you with it's property...
webwiz posted this at 19:17 — 26th May 2007.
He has: 629 posts
Joined: May 2007
Thanks for the test page, Megan.
Checking on Win xp pro, your page shows:
Letter-spacing works in IE 5.01 and up; Firefox 2, Opera 9, Netscape 7.2, and Moz 1.7.
Word-spacing works in the above except for IE 5.01 and IE 5.5.
Incidentally, I sometimes use a negative letter-spacing for headings. Depending on the font, it can give a nice effect. Letter-spacing: -1px; is usually enough.
Cordially, David.
Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;
Megan posted this at 13:15 — 28th May 2007.
She has: 11,421 posts
Joined: Jun 1999
That's a good idea, David! I'll have to try that sometime.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.