<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1041788" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1041788</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Nope.  Divs assume the width</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/css-float-and-center-align#comment-1233018</link>
    <description> &lt;p&gt;Nope.  Divs assume the width of the element it&#039;s in unless you specify otherwise.&lt;/p&gt;
 </description>
     <pubDate>Wed, 03 Sep 2008 13:11:14 +0000</pubDate>
 <dc:creator>pr0gr4mm3r</dc:creator>
 <guid isPermaLink="false">comment 1233018 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Is there any way to center a</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/css-float-and-center-align#comment-1233016</link>
    <description> &lt;p&gt;Is there any way to center a div without using a width?&lt;/p&gt;
 </description>
     <pubDate>Wed, 03 Sep 2008 12:01:12 +0000</pubDate>
 <dc:creator>kamaldeeps</dc:creator>
 <guid isPermaLink="false">comment 1233016 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>If you don&#039;t want to assign</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/css-float-and-center-align#comment-1232757</link>
    <description> &lt;p&gt;If you don&#039;t want to assign widths, assign margins to inner divs, or paddings to the wrapper divs... That&#039;s will adjust the overall width of the page depending on the resolution of the monitor or size of the browser window...&lt;/p&gt;
 </description>
     <pubDate>Thu, 28 Aug 2008 01:40:58 +0000</pubDate>
 <dc:creator>demonhale</dc:creator>
 <guid isPermaLink="false">comment 1232757 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>I avoid using &quot;hacks&quot; to set</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/css-float-and-center-align#comment-1232752</link>
    <description> &lt;p&gt;I avoid using &quot;hacks&quot; to set styles for specific browsers, like IE&lt;/p&gt;
&lt;p&gt;They might work today, but watch out on the next release, they might just stop working.&lt;/p&gt;
&lt;p&gt;Best to use standards-compliant css for all browsers (even if there are slight variations)&lt;/p&gt;
&lt;p&gt;In a pinch, I might use a browser-sniffing script to set a style on the fly - at least that will not degrade in a new browser release!&lt;/p&gt;
 </description>
     <pubDate>Wed, 27 Aug 2008 19:15:38 +0000</pubDate>
 <dc:creator>decibel.places</dc:creator>
 <guid isPermaLink="false">comment 1232752 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>By the way: IE (can&#039;t</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/css-float-and-center-align#comment-1232750</link>
    <description> &lt;p&gt;By the way: IE (can&#039;t remember if it&#039;s just six or version seven too) treats &lt;code&gt;width&lt;/code&gt; the same way standards-compliant browsers treat &lt;code&gt;min-width&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;So, if you put &lt;code&gt;min-width&lt;/code&gt; in your main style sheet, then &lt;code&gt;width&lt;/code&gt; in your IE-specific style sheet you&#039;ll get the same behaviour from all browsers. Hope that makes sense. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The thing to remember about &lt;code&gt;span&lt;/code&gt; tags is that they are inline level elements. So they can only contain other inline elements like text (and probably pictures, if I remember correctly). No paragraphs, lists, divs or whatnot may go inside a &lt;code&gt;span&lt;/code&gt; tag.&lt;/p&gt;
 </description>
     <pubDate>Wed, 27 Aug 2008 18:47:10 +0000</pubDate>
 <dc:creator>JeevesBond</dc:creator>
 <guid isPermaLink="false">comment 1232750 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>You will probably need to</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/css-float-and-center-align#comment-1232749</link>
    <description> &lt;blockquote&gt;&lt;p&gt;You will probably need to assign a width to the container unless you want it to be 100%&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I imagine a scenario like:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;div style=&amp;quot;text-align: center&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;div style=&amp;quot;width: 50%&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;I usually just use spans when I want to style a very small chunk, a word in a sentence for example. They can get messy when used for big elements...&lt;/p&gt;
&lt;p&gt;to center the inner div - yes, you do need a width, the browser cannot read your mind (yet) &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 27 Aug 2008 18:40:57 +0000</pubDate>
 <dc:creator>decibel.places</dc:creator>
 <guid isPermaLink="false">comment 1232749 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>But as pr0gr4mm3r rightly</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/css-float-and-center-align#comment-1232739</link>
    <description> &lt;p&gt;But as pr0gr4mm3r rightly said, if a div has no specified width, it stretches the full width of the area it&#039;s in. so any form of center align/margins auto etc will make no difference.&lt;/p&gt;
&lt;p&gt;I will have a play sith spans, never really used them that much to be honest, perhaps that might resolve my issue, otherwise I&#039;m stuck with min-width or not centered&lt;/p&gt;
 </description>
     <pubDate>Wed, 27 Aug 2008 16:58:55 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1232739 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>hmmm
seems like you need to</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/css-float-and-center-align#comment-1232737</link>
    <description> &lt;p&gt;hmmm&lt;/p&gt;
&lt;p&gt;seems like you need to put the div in a container and set the property of the parent/container to center it&lt;/p&gt;
&lt;p&gt;the text-align:center property can work, but not always&lt;/p&gt;
&lt;p&gt;using &lt;code&gt;&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;/code&gt; can also center the content, sometimes this works when the css property doesn&#039;t.&lt;/p&gt;
&lt;p&gt;You will probably need to assign a width to the container unless you want it to be 100%&lt;/p&gt;
&lt;p&gt;Remember that width properties can be percent as well as em (relative to the doc font size) for a more fluid effect...&lt;/p&gt;
 </description>
     <pubDate>Wed, 27 Aug 2008 16:47:44 +0000</pubDate>
 <dc:creator>decibel.places</dc:creator>
 <guid isPermaLink="false">comment 1232737 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>A div will fill the largest</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/css-float-and-center-align#comment-1232736</link>
    <description> &lt;p&gt;A div will fill the largest possible width unless you tell it something different.  I believe that a span tag won&#039;t stretch to the width of the page, but I don&#039;t know if one can be placed outside a div tag.&lt;/p&gt;
 </description>
     <pubDate>Wed, 27 Aug 2008 15:38:07 +0000</pubDate>
 <dc:creator>pr0gr4mm3r</dc:creator>
 <guid isPermaLink="false">comment 1232736 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
