<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>fragmente &#187; float</title>
	<atom:link href="http://blog.team-noir.net/tag/float/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.team-noir.net</link>
	<description>team noir blog</description>
	<lastBuildDate>Thu, 19 Jan 2012 15:04:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>CSS floating problems</title>
		<link>http://blog.team-noir.net/2009/06/css-floating-problems/</link>
		<comments>http://blog.team-noir.net/2009/06/css-floating-problems/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 16:30:24 +0000</pubDate>
		<dc:creator>karrock</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[clear]]></category>
		<category><![CDATA[float]]></category>

		<guid isPermaLink="false">http://blog.team-noir.net/?p=127</guid>
		<description><![CDATA[Today I had a really annoying problem with two floated elements and a clear afterwards. It´s well known if you want to put two elements (two div-container) side by side instead of one below the other you have to use CSS-floating and to stop the float afterwards (to start the normal document flow) you have [...]
Related posts:<ol>
<li><a href='http://blog.team-noir.net/2009/08/floating-problems-with-ie-6/' rel='bookmark' title='Floating problems with IE 6'>Floating problems with IE 6</a></li>
<li><a href='http://blog.team-noir.net/2010/05/how-to-use-position-absolute-and-z-index-with-internet-explorer-7-and-nested-containers/' rel='bookmark' title='How to use position-absolute and z-index with Internet Explorer 7 and nested containers'>How to use position-absolute and z-index with Internet Explorer 7 and nested containers</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Today I had a really annoying problem with two floated elements and a clear afterwards. It´s well known if you want to put two elements (two <span style="font-family: courier new,courier;">div</span>-container) side by side instead of one below the other you have to use CSS-floating and to stop the float afterwards (to start the normal document flow) you have to clear the elements.</p>
<pre><code>.element_a {float: left;}
.element_b {float: right;}
.element_c {clear: both;}</code></pre>
<p>Today I had this problem. I was using within a YAML Layout (middle column) some elements, two were floated like shown above. Now I do a css clear for the <span style="font-family: courier new,courier;">hr</span>-tag (horizontal dashed line) to stop floating. What I got was the stopped floating, but also a big gap above the line (see first picture below). I was now trying with Firebug and other tools to eliminate this gap for one or two hours and it doesn´t work.<br />
I just wanted to put a negative <span style="font-family: courier new,courier;">margin-top</span> to slide the element above. But this doesn´t work at all! <img src='http://blog.team-noir.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p><span id="more-127"></span></p>
<p>Then I had an idea: I tried out, if this problem also occur when I set a other element (instead of the <span style="font-family: courier new,courier;">hr</span>-line) after the floated elements and clear this one. So I put an empty <span style="font-family: courier new,courier;">div</span>-container after the floated elements, but I get the same problem.<br />
I remembered the idea with the negative margin and test a little bit around with Firebug and then I see the solution. I can´t minimize the gap itself above the line. But I can set a negative margin for the bottom of the empty <span style="font-family: courier new,courier;">div</span>-container, which will pull the elements a few pixels nearer to the top.</p>
<p>I tried it out and it worked! So if you have a similar problem you don´t have to clear the <span style="font-family: courier new,courier;">hr</span>-element. Set just a <span style="font-family: courier new,courier;">div</span>-element after the floated container and clear this one. Then set a negativ <span style="font-family: courier new,courier;">margin-bottm</span> to close the gap above! Now I´m happy and can let the day end &#8230; in freedom. <img src='http://blog.team-noir.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>PS:<br />
Sorry that there will be no example available. I can´t put the HTML and CSS code here. But I can show you a little picture to illustrate the problem.</p>
<div id="attachment_129" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.team-noir.net/wp-content/uploads/2009/06/clearing_problem.jpg"><img class="size-medium wp-image-129" title="Problem with clearing" src="http://blog.team-noir.net/wp-content/uploads/2009/06/clearing_problem-300x46.jpg" alt="Problem with clearing" width="300" height="46" /></a><p class="wp-caption-text">Problem with clearing</p></div>
<div id="attachment_132" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.team-noir.net/wp-content/uploads/2009/06/clearing_solution.jpg"><img class="size-medium wp-image-132" title="clearing_solution" src="http://blog.team-noir.net/wp-content/uploads/2009/06/clearing_solution-300x37.jpg" alt="Solution of the clearing problem" width="300" height="37" /></a><p class="wp-caption-text">Solution of the clearing problem</p></div>
<p>Related posts:<ol>
<li><a href='http://blog.team-noir.net/2009/08/floating-problems-with-ie-6/' rel='bookmark' title='Floating problems with IE 6'>Floating problems with IE 6</a></li>
<li><a href='http://blog.team-noir.net/2010/05/how-to-use-position-absolute-and-z-index-with-internet-explorer-7-and-nested-containers/' rel='bookmark' title='How to use position-absolute and z-index with Internet Explorer 7 and nested containers'>How to use position-absolute and z-index with Internet Explorer 7 and nested containers</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.team-noir.net/2009/06/css-floating-problems/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

