Wrox Programmer Forums
|
BOOK Beginning CSS: Cascading Style Sheets for Web Design, 2nd Ed; ISBN: 978-0-470-09697-0
This is the forum to discuss the Wrox book Beginning CSS: Cascading Style Sheets for Web Design, 2nd Edition by Richard York; ISBN: 9780470096970
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK Beginning CSS: Cascading Style Sheets for Web Design, 2nd Ed; ISBN: 978-0-470-09697-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 12th, 2009, 05:56 AM
Registered User
 
Join Date: Oct 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to code a space between words

this should be easy but I have a horizontal list of hyper;inks and i wish to insert several spaces between the words as the appear in the browser. how do i do this? I tried using white-space: pre; but this preserves all white space in the div which i don't want.
 
Old October 12th, 2009, 08:05 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

You can use   for each space.

If you want equal spaces between words, then you can use following "style":
Code:
<style>
<!--
.word{word-spacing: 20px;}
.letter{letter-spacing: 20px;}
-->
</style>
<p class="word">You can see words in this line are 20 pixels apart</p>
<p class="letter">You can see letters is this line are 20 pixels apart</p>
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.

Last edited by om_prakash; October 12th, 2009 at 08:08 AM..
 
Old October 12th, 2009, 09:17 AM
Registered User
 
Join Date: Oct 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

om,

thanks!
 
Old January 1st, 2010, 02:11 PM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

Quote:
Originally Posted by om_prakash View Post
You can use &nbsp; for each space.

If you want equal spaces between words, then you can use following "style":
Code:
<style>
<!--
.word{word-spacing: 20px;}
.letter{letter-spacing: 20px;}
-->
</style>
<p class="word">You can see words in this line are 20 pixels apart</p>
<p class="letter">You can see letters is this line are 20 pixels apart</p>
Using CSS is the much better of the two solutions. As you can see it merely requires including a class in the element (or a CssClass attribute in a web control). Then all the spacing can be easily controlled from the stylesheet. If you use &nbsp; it hardcodes the spaces into the design making it difficult to read and maintain later.
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to count words in pdf document + php + source code ravihj PHP How-To 0 July 16th, 2009 05:58 AM
'how to count words in pdf document + php + source code' ravihj PHP How-To 0 July 16th, 2009 05:57 AM
Words Document maha HTML Code Clinic 8 September 29th, 2004 03:08 AM
why I can't use Chinese words? cash Pro JSP 1 February 17th, 2004 02:40 PM
generating words kozam C++ Programming 1 September 30th, 2003 12:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.