<?xml version="1.0"?>
<rss version="2.0">
 <channel>
  <title>CSS text alignment question | WPDFD.com Forums</title>
  <link>http://www.wpdfd.com/forums/wpdfd/layout/css_text_alignment_question/</link>
  <description>A Layout forum thread at WPDFD.com</description>
  <language>en-us</language>
  <pubDate>11/18/04, 323 45 2004 2004:%i:1100763936 02:45:36</pubDate>
  <lastBuildDate>06/07/13, 158 43 2013 2013:%i:1370591031 03:43:51</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>NineLabs Framework Feed Generator</generator>
  <managingEditor>sitemaster@wpdfd.com</managingEditor>
  <webMaster>sitemaster@wpdfd.com</webMaster>
     <item>
    <title>Schomer  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/css_text_alignment_question/#p1585</link>
    <description><![CDATA[Hi All,<br /><br />I'm trying to get text inside a div box to align to the left, center, and right - something like this:<br /><br /> -------------------------------------------------------------------<br />&#124; left text                     center text                    right text  &#124;<br /> -------------------------------------------------------------------<br /><br />I tried breaking up each part of the text into a separate div, specifying them to be inline. That got everything to appear on one line. But I have not been able to get the alignment/spacing to happen at all.<br /><br />Is this even possible with CSS?<br /><br />Thanks,<br />Schomer]]></description>
    <pubDate>11/18/04, 323 45 2004 2004:%i:1100763936 02:45:36</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/css_text_alignment_question/#p1585</guid>
   </item>
     <item>
    <title>Joe Gillespie said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/css_text_alignment_question/#p1586</link>
    <description><![CDATA[The easy way to do it would be to set the text to justify and then<br /><br />left&amp;nbsp;text &nbsp; center&amp;nbsp;text &nbsp; &nbsp;right&amp;nbsp;<br /><br /><br />Putting a non-breaking space between words makes the sentence one big word.<br /><br />Otherwise, you would need three nested, float left, divs - one text-align: left, one text-align: center, one text-align: right]]></description>
    <pubDate>11/18/04, 323 20 2004 2004:%i:1100773257 05:20:57</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/css_text_alignment_question/#p1586</guid>
   </item>
     <item>
    <title>Schomer  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/css_text_alignment_question/#p1587</link>
    <description><![CDATA[I tested your idea about three nested divs, but the text-align attribute only works on the contents of those divs, not the divs themselves, so I wasn't able to get it to work. Also, I wasn't sure what you meant about floating all three left and how that would do anything but stack them up with a left alignment.<br /><br />I did some messing around and came up with the following:<br /><br />#container {<br /> &nbsp; &nbsp; &nbsp; &nbsp;border: 1px solid #333;<br /> &nbsp; &nbsp; &nbsp;margin: 100px;<br /> &nbsp; &nbsp; &nbsp;text-align:center;<br /> &nbsp; &nbsp; &nbsp; &nbsp;}<br />#left {<br /> &nbsp; &nbsp; &nbsp;display: inline;<br /> &nbsp; &nbsp; &nbsp;float: left;<br /> &nbsp; &nbsp; &nbsp; &nbsp;}<br />#center {<br /> &nbsp; &nbsp; &nbsp;display: inline;<br /> &nbsp; &nbsp; &nbsp;}<br />#right {<br /> &nbsp; &nbsp; &nbsp;display: inline;<br /> &nbsp; &nbsp; &nbsp;float: right;<br /> &nbsp; &nbsp; &nbsp; &nbsp;}<br /><br />The first important thing I realized was the need to give the container div a text-align:center. This centers the three divs inside.<br /><br />From there, setting all three of the inside divs to display:inline makes them appear on one line.<br /><br />Lastly, on the left div I did float:left, and on the right div, I did float:right. <br /><br />This seemed to give me exactly what I was looking for - although, I have only tested it in Safari at this point...<br /><br />Does this look like a decent way to do this?<br /><br /><br />]]></description>
    <pubDate>11/18/04, 323 44 2004 2004:%i:1100832262 21:44:22</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/css_text_alignment_question/#p1587</guid>
   </item>
     <item>
    <title>Joe Gillespie said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/layout/css_text_alignment_question/#p1588</link>
    <description><![CDATA[This is how I would do it...<br /><br />(If you want the border around everything, you will have to specify some heights.)<br /><br /><code><br />&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;<br /> &nbsp; &nbsp; &nbsp; &nbsp;&quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;<br />&lt;html lang=&quot;en&quot;&gt;<br />&lt;head&gt;<br /> &nbsp; &nbsp; &nbsp;&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=iso-8859-1&quot;&gt;<br /> &nbsp; &nbsp; &nbsp;&lt;title&gt;Untitled&lt;/title&gt;<br /> &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp;&lt;style type=&quot;text/css&quot; title=&quot;text/css&quot; media=&quot;all&quot;&gt;<br />&lt;!--<br />#container<br />{<br />margin: 100px;<br />}<br /><br />#left<br />{<br />float: left;<br />text-align: left;<br />width: 33%;<br />background-color: red;<br />}<br /><br />#center<br />{<br />float: left;<br />text-align: center;<br />width: 33%;<br />background-color: yellow;<br />}<br /><br />#right<br />{<br />float: left;<br />text-align: right;<br />width: 33%;<br />background-color: blue;<br />} <br />--&gt;<br />&lt;/style&gt;<br />&lt;/head&gt;<br />&lt;body&gt;<br />&lt;div id=&quot;container&quot;&gt;&lt;div id=&quot;left&quot;&gt;left text&lt;/div&gt;&lt;div id=&quot;center&quot;&gt;center text&lt;/div&gt;&lt;div id=&quot;right&quot;&gt;right text&lt;/div&gt;<br />&lt;/div&gt;<br /><br />&lt;/body&gt;<br />&lt;/html&gt;<br /></code>]]></description>
    <pubDate>11/19/04, 324 53 2004 2004:%i:1100843581 00:53:01</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/layout/css_text_alignment_question/#p1588</guid>
   </item>
   </channel>
</rss