<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: CSS Absolute and Relative positioning &#8211; explained</title>
	<atom:link href="http://www.webopius.com/content/144/css-absolute-and-relative-positioning-explained/feed" rel="self" type="application/rss+xml" />
	<link>http://www.webopius.com/content/144/css-absolute-and-relative-positioning-explained</link>
	<description>Web Design &#38; Development, SEO and Project Management</description>
	<lastBuildDate>Thu, 15 Dec 2011 08:22:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Webopius</title>
		<link>http://www.webopius.com/content/144/css-absolute-and-relative-positioning-explained/comment-page-1#comment-545</link>
		<dc:creator>Webopius</dc:creator>
		<pubDate>Fri, 20 Mar 2009 09:51:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.webopius.com/content/?p=144#comment-545</guid>
		<description>Hi Dan, 

My head was also giving pain when I started using relative/absolute positions!

Yes, if you want to position the boxes using absolute positioning, that&#039;s exactly what you do. Remember to set the parent box position to be &#039;relative&#039; to make it the nearest positioned parent element. 

Here&#039;s an example of what you describe (If you view the source, you&#039;ll see I put borders around the boxes so the widths are allowing for this):

&lt;style type=&quot;text/css&quot;&gt;
	#parent { border:solid 1px; width: 162px; height: 54px; position: relative }
	#box1 { border: solid 2px; width: 50px; height: 50px; position: absolute; top: 0px; left: 0px }
	#box2 { border: solid 2px; width: 50px; height: 50px; position: absolute; top: 0px; left: 54px }
	#box3 { border: solid 2px; width: 50px; height: 50px; position: absolute; top: 0px; left: 108px }
&lt;/style&gt;

&lt;div id=&quot;parent&quot;&gt;
	&lt;div id=&quot;box1&quot;&gt;box1 content&lt;/div&gt;
	&lt;div id=&quot;box2&quot;&gt;box2 content&lt;/div&gt;
	&lt;div id=&quot;box3&quot;&gt;box3 content&lt;/div&gt;
&lt;/div&gt;</description>
		<content:encoded><![CDATA[<p>Hi Dan, </p>
<p>My head was also giving pain when I started using relative/absolute positions!</p>
<p>Yes, if you want to position the boxes using absolute positioning, that&#8217;s exactly what you do. Remember to set the parent box position to be &#8216;relative&#8217; to make it the nearest positioned parent element. </p>
<p>Here&#8217;s an example of what you describe (If you view the source, you&#8217;ll see I put borders around the boxes so the widths are allowing for this):</p>
<style type="text/css">
	#parent { border:solid 1px; width: 162px; height: 54px; position: relative }
	#box1 { border: solid 2px; width: 50px; height: 50px; position: absolute; top: 0px; left: 0px }
	#box2 { border: solid 2px; width: 50px; height: 50px; position: absolute; top: 0px; left: 54px }
	#box3 { border: solid 2px; width: 50px; height: 50px; position: absolute; top: 0px; left: 108px }
</style>
<div id="parent">
<div id="box1">box1 content</div>
<div id="box2">box2 content</div>
<div id="box3">box3 content</div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.webopius.com/content/144/css-absolute-and-relative-positioning-explained/comment-page-1#comment-544</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Fri, 20 Mar 2009 09:30:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.webopius.com/content/?p=144#comment-544</guid>
		<description>Ouch. My head hurts. What I don&#039;t understand is how would three child elements line up if they were positioning in a box? I understand one child element.

So if I have parent box with b1,b2,b3 inside it:

If b1 is 50px x 50px do I have to then give b2 a position left:50px for it to be on the right of it?</description>
		<content:encoded><![CDATA[<p>Ouch. My head hurts. What I don&#8217;t understand is how would three child elements line up if they were positioning in a box? I understand one child element.</p>
<p>So if I have parent box with b1,b2,b3 inside it:</p>
<p>If b1 is 50px x 50px do I have to then give b2 a position left:50px for it to be on the right of it?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.479 seconds -->

