Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 12th, 2009, 05:56 AM
Registered User
 
Join Date: Oct 2009
Location: montreal
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.
__________________
Live Long and Prosper
Reply With Quote
  #2 (permalink)  
Old October 12th, 2009, 08:05 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
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.
Reply With Quote
  #3 (permalink)  
Old October 12th, 2009, 09:17 AM
Registered User
 
Join Date: Oct 2009
Location: montreal
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

om,

thanks!
__________________
Live Long and Prosper
Reply With Quote
  #4 (permalink)  
Old January 1st, 2010, 01:11 PM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 01:40 PM
generating words kozam C++ Programming 1 September 30th, 2003 12:55 PM



All times are GMT -4. The time now is 02:29 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.