<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1042061" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1042061</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Right, so clearing the</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/div-floats-child-and-parent#comment-1234268</link>
    <description> &lt;p&gt;Right, so clearing the floats with a div within the parent should sort the issue.&lt;/p&gt;
&lt;p&gt;It&#039;s a good fix, thanks for that.&lt;/p&gt;
&lt;p&gt;Although, still a little illogical imo. Anything inside a div should remain in there, and after the parent&#039;s &lt;code&gt;&amp;lt;/div&amp;gt;&lt;/code&gt; any other divs shouldn&#039;t be floated, aligned or anything else at all from the properties of the inner divs as they are contained inside a container.&lt;/p&gt;
 </description>
     <pubDate>Wed, 15 Oct 2008 13:54:42 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1234268 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Ok I get what you mean, look</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/div-floats-child-and-parent#comment-1234237</link>
    <description> &lt;p&gt;Ok I get what you mean, look at my example below to help you fix what you want your property to look like. You just need to clear div elements. However clearing an existing div element for the purpose of inline displays is a little tricky so you need at least to declare clearing properties to clear elements. This will work for what you want...&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;test&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;style media=&amp;quot;all&amp;quot; type=&amp;quot;text/css&amp;quot;&amp;gt;&lt;br /&gt;#my_div{&lt;br /&gt;margin: 10px;&lt;br /&gt;background:#c00000;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#float_div_A{&lt;br /&gt;margin: 10px;&lt;br /&gt;width: 200px;&lt;br /&gt;float: left;&lt;br /&gt;background:#808080;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#float_div_B{&lt;br /&gt;margin: 10px;&lt;br /&gt;width: 200px;&lt;br /&gt;float: right;&lt;br /&gt;background:#e0e0e0;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;.fixfloat:after {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; content: &amp;quot;.&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; display: block;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; clear: both;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; visibility: hidden;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;.fixfloat {display: inline-block;}&amp;nbsp; /* for IE/Mac */&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;lt;!--[if IE]&amp;gt;&lt;br /&gt;&amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; .fixfloat {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; zoom: 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; display: block;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&amp;lt;![endif]--&amp;gt;&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;div id=&amp;quot;my_div&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;div id=&amp;quot;float_div_A&amp;quot;&amp;gt;COLUMN ONE wewewe we we we we we &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;div id=&amp;quot;float_div_B&amp;quot;&amp;gt;COLUMN TWO wewe we wewe we we we &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;div class=&amp;quot;fixfloat&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 07 Oct 2008 13:41:42 +0000</pubDate>
 <dc:creator>demonhale</dc:creator>
 <guid isPermaLink="false">comment 1234237 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>demonhale wrote:
No</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/div-floats-child-and-parent#comment-1234236</link>
    <description> &lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;demonhale&lt;/em&gt; wrote:&lt;/div&gt;No properties for the parent div makes it appear pushed down beneath the parent since your two inner floated div&#039;s in the example has a 10px margin. So it would appear beneath when it is actually just pushed 10px down since there is no property for it&#039;s wrapper.&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;I understand what you say, but not only is it an illogical way for it to work, but it&#039;s also only true without content inside it to give that parent div a height. It is also seemingly ture when using floated inner divs, and is my confusion,&lt;/p&gt;
&lt;p&gt;If you have a parent div without height or anything else, but place an inner div inside it and the inner div has text, it WILL go inside the parent and stretch the parent&#039;s height to the same as the inner div.&lt;/p&gt;
&lt;p&gt;And this is logical. If the parent div is infinite size, i.e. no properties at all, you should be able to put any sized div INSIDE it and that div will stretch the parent as it is wrapped inside the parent&#039;s open div and closed div code.&lt;/p&gt;
&lt;p&gt;Which is ideal for dynamic content, as setting a height for a parent div is not always possible.&lt;/p&gt;
&lt;p&gt;Here&#039;s an example of one I did recently that didn&#039;t work until I added a height to the parent div, which made it useless for dynamic content...&lt;/p&gt;
&lt;p&gt;The CSS&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;.parent_div{&lt;br /&gt;height: 57px; //ADDED TO MAKE THE INNER DIVS GO INSIDE THIS PARENT&lt;br /&gt;margin: 30px 0px 0px 10px;&lt;br /&gt;background-color: #EFEFC7;&lt;br /&gt;border: 1px solid #CFCF4F;&lt;br /&gt;}&lt;br /&gt;.inner_left_div{&lt;br /&gt;margin: 12px 0px 0px 45px;&lt;br /&gt;float: left;&lt;br /&gt;}&lt;br /&gt;.inner_right_div{&lt;br /&gt;margin: 7px 30px 0px 0px;&lt;br /&gt;float: left;&lt;br /&gt;float: right;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;The HTML&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;div &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;class=&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;parent_div&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;&amp;gt;&lt;br /&gt; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;div &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;class=&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;inner_left_div&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;float left&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;&amp;gt;&lt;br /&gt; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;div &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;class=&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;inner_right_div&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;float right div&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;If you remove the height for the parent (and no other changes), the two floated divs don&#039;t go inside it.&lt;br /&gt;
BUT - If you remove the height AND remove the floats for the inner divs (and no other changes), they DO go inside it.&lt;br /&gt;
How is that logical? I see it&#039;s the float that stops the desired functionality, but if inner divs go inside parent without float, they surely should also go inside with float and float as per their properties STILL within the parent div as boundaries.&lt;/p&gt;
&lt;p&gt;There must be a way around this without setting height.&lt;/p&gt;
 </description>
     <pubDate>Tue, 07 Oct 2008 12:09:00 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1234236 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Well I tried that several</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/div-floats-child-and-parent#comment-1234209</link>
    <description> &lt;p&gt;Well I tried that several times as long as I define a height property the inner div&#039;s would always copy the properties of the parent div. It is never advised to float a div inside a parent with no defined attributes.&lt;/p&gt;
&lt;p&gt;Floating an element (div&#039;s, images etc) will float inside it&#039;s wrapper or parent div as long as the parent div has a defined property. No properties for the parent div makes it appear pushed down beneath the parent since your two inner floated div&#039;s in the example has a 10px margin. So it would appear beneath when it is actually just pushed 10px down since there is no property for it&#039;s wrapper. &lt;/p&gt;
&lt;p&gt;Divs if you imagine are like image layers, if you define a bigger property for the inner layers, it will have that property but since it&#039;s parent layer has no property, it will just remain hidden but the inner layers are still over it.&lt;/p&gt;
 </description>
     <pubDate>Tue, 07 Oct 2008 04:28:40 +0000</pubDate>
 <dc:creator>demonhale</dc:creator>
 <guid isPermaLink="false">comment 1234209 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>demonhale wrote:
Actually</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/div-floats-child-and-parent#comment-1234189</link>
    <description> &lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;demonhale&lt;/em&gt; wrote:&lt;/div&gt;Actually the floated div&#039;s will fall inside the #my_div and apply the margin properties to the inner floated div&#039;s.&lt;/div&gt;You would think... and is why I made this thread, as often I find they don&#039;t, and floating the wrapper div usually resolves it.&lt;/p&gt;
&lt;p&gt;So I was wondering what makes this happen? Some properties of the inner divs perhaps?&lt;/p&gt;
 </description>
     <pubDate>Mon, 06 Oct 2008 12:04:47 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1234189 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Actually the floated div&#039;s</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/div-floats-child-and-parent#comment-1234159</link>
    <description> &lt;p&gt;Actually the floated div&#039;s will fall inside the #my_div and apply the margin properties to the inner floated div&#039;s. &lt;/p&gt;
&lt;p&gt;Yes it is also good practice to define height and width properties to wrapper div elements, to make it dynamic you can define 100% for these properties and it will adapt to parent wrappers...&lt;/p&gt;
 </description>
     <pubDate>Sun, 05 Oct 2008 20:08:09 +0000</pubDate>
 <dc:creator>demonhale</dc:creator>
 <guid isPermaLink="false">comment 1234159 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
