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
--
"Old web developers don't die, they degrade gracefully..."
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
--
"Old web developers don't die, they degrade gracefully..."
Greg K posted this at 01:48 — 24th May 2007.
He has: 1,665 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
[This space intentionally left blank]
Cool Geek Supplies: www.ThinkGeek.com
webwiz posted this at 02:14 — 24th May 2007.
He has: 339 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
--
"Old web developers don't die, they degrade gracefully..."
brady.k posted this at 02:05 — 24th May 2007.
He has: 1,383 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.
Kyle Brady, President, Intuitive Industries LLC.
http://www.int-ind.com
[EMAIL=brady.k@gmail.com]brady.k@gmail.com[/EMAIL] - [EMAIL=brady.kyle@int-ind.com]brady.kyle@int-ind.com[/EMAIL]
Megan posted this at 13:15 — 24th May 2007.
She has: 10,288 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
My web design blog
demonhale posted this at 01:22 — 25th May 2007.
He has: 3,301 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
Visit my New Blog Gee, Please... | Designer Graphics 9
Megan posted this at 12:51 — 25th May 2007.
She has: 10,288 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
My web design blog
Megan posted this at 13:22 — 25th May 2007.
She has: 10,288 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,301 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...
Visit my New Blog Gee, Please... | Designer Graphics 9
webwiz posted this at 19:17 — 26th May 2007.
He has: 339 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
--
"Old web developers don't die, they degrade gracefully..."
Megan posted this at 13:15 — 28th May 2007.
She has: 10,288 posts
Joined: Jun 1999
That's a good idea, David! I'll have to try that sometime.