HighDots Forums  

Horizontal equal spacing

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Horizontal equal spacing in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andrew Poulos
 
Posts: n/a

Default Horizontal equal spacing - 06-14-2006 , 07:46 AM






If I have a short sequence of words that are on one line, within the
confines of a fixed width DIV, how can I position them so that the
spaces between the words are all of equal size (with half a space
trailing and leading)? For example,

xxxFIRSTxxxxxxSECONDxxxxxxTHIRDxxxxxxFOURTHxxx

where 'xxxxxx' represents the space.

Andrew Poulos

Reply With Quote
  #2  
Old   
Jim Moe
 
Posts: n/a

Default Re: Horizontal equal spacing - 06-14-2006 , 04:42 PM






Andrew Poulos wrote:
Quote:
If I have a short sequence of words that are on one line, within the
confines of a fixed width DIV, how can I position them so that the
spaces between the words are all of equal size (with half a space
trailing and leading)? For example,

xxxFIRSTxxxxxxSECONDxxxxxxTHIRDxxxxxxFOURTHxxx

where 'xxxxxx' represents the space.

One way is to create a <span> class with equal margin-left and margin-right.
..eq-space span { margin: 0 10%; }
<div class="eq-space"><span>FIRST</span><span>SECOND</span>...</div>

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)


Reply With Quote
  #3  
Old   
Andrew Poulos
 
Posts: n/a

Default Re: Horizontal equal spacing - 06-14-2006 , 06:47 PM



Jim Moe wrote:
Quote:
Andrew Poulos wrote:
If I have a short sequence of words that are on one line, within the
confines of a fixed width DIV, how can I position them so that the
spaces between the words are all of equal size (with half a space
trailing and leading)? For example,

xxxFIRSTxxxxxxSECONDxxxxxxTHIRDxxxxxxFOURTHxxx

where 'xxxxxx' represents the space.

One way is to create a <span> class with equal margin-left and margin-right.
.eq-space span { margin: 0 10%; }
div class="eq-space"><span>FIRST</span><span>SECOND</span>...</div

Thanks, I had to play around with the percentages but it works fine.

Andrew Poulos


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.