<?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>CSS Tutorials and CSS Articles &#187; CSS Margin</title>
	<atom:link href="http://www.cssmaster.co.uk/tag/css-margin/feed" rel="self" type="application/rss+xml" />
	<link>http://www.cssmaster.co.uk</link>
	<description>CSS tutorials and articles</description>
	<lastBuildDate>Tue, 02 Feb 2010 01:43:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSS Align Using Margin</title>
		<link>http://www.cssmaster.co.uk/css-align-using-margin</link>
		<comments>http://www.cssmaster.co.uk/css-align-using-margin#comments</comments>
		<pubDate>Fri, 29 Jan 2010 00:14:00 +0000</pubDate>
		<dc:creator>CSS Master</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[CSS Align]]></category>
		<category><![CDATA[CSS Margin]]></category>

		<guid isPermaLink="false">http://www.cssmaster.co.uk/?p=90</guid>
		<description><![CDATA[You will often want to center align a block element (such as a div).  Personally I find the best way to do this is to use CSS Align Using Margin.  
Setting a margin to auto will try and force the element to the opposite side.  So, if you set both left and [...]]]></description>
			<content:encoded><![CDATA[<p>You will often want to center align a block element (such as a div).  Personally I find the best way to do this is to use <strong>CSS Align Using Margin</strong>.  </p>
<p>Setting a margin to auto will try and force the element to the opposite side.  So, if you set both left and right margins to auto, the browser will put the browser in center.</p>
<p>Let&#8217;s take a look at the follow example CSS code, to be applied to a block element like a div:<br />
<code><br />
.centerme{<br />
&nbsp;&nbsp;width:100px;<br />
&nbsp;&nbsp;margin-left:auto;<br />
&nbsp;&nbsp;margin-right:auto;<br />
}<br />
</code><br />
It is very important you set a width on the element.  You cannot center align something that takes up the full width of it&#8217;s container.  Imagine a room full of water, you cannot make the water go into the center of the room without forcing its sides in.  Bit of an odd analogy, but you get the meaning.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cssmaster.co.uk/css-align-using-margin/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Margin</title>
		<link>http://www.cssmaster.co.uk/css-margin</link>
		<comments>http://www.cssmaster.co.uk/css-margin#comments</comments>
		<pubDate>Sat, 16 Jan 2010 22:43:37 +0000</pubDate>
		<dc:creator>CSS Master</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[CSS Margin]]></category>

		<guid isPermaLink="false">http://www.cssmaster.co.uk/?p=46</guid>
		<description><![CDATA[CSS Margin can be used to manipulate the space around an HTML element.
The below div have absolutely no margin on it.

No margin

If we add 10 pixels margin:

10px margin

As you can see, the CSS: .my_div { margin:10px; } adds 10 pixels of margin on ALL sides of the element.  This includes the top AND bottom, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>CSS Margin</strong> can be used to manipulate the space around an HTML element.</p>
<p>The below div have absolutely no margin on it.</p>
<div style="background-color:green;">
<div style="margin:0px;border:1px solid #000;color:#fff;">No margin</div>
</div>
<p>If we add 10 pixels margin:</p>
<div style="background-color:green;">
<div style="margin:10px;border:1px solid #000;color:#fff;">10px margin</div>
</div>
<p>As you can see, the CSS: <code>.my_div { margin:10px; }</code> adds 10 pixels of margin on ALL sides of the element.  This includes the top AND bottom, left AND right, so be careful when positioning elements and calculating widths.  A 10px margin on an element makes it 20 pixels wider, and 20 pixels higher.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cssmaster.co.uk/css-margin/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS Box Model</title>
		<link>http://www.cssmaster.co.uk/css-box-model</link>
		<comments>http://www.cssmaster.co.uk/css-box-model#comments</comments>
		<pubDate>Sat, 16 Jan 2010 20:02:22 +0000</pubDate>
		<dc:creator>CSS Master</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[CSS Border]]></category>
		<category><![CDATA[CSS Box Model]]></category>
		<category><![CDATA[CSS Margin]]></category>
		<category><![CDATA[CSS Padding]]></category>

		<guid isPermaLink="false">http://www.cssmaster.co.uk/?p=35</guid>
		<description><![CDATA[The CSS Box Model is essential when learning CSS to create web page layouts.  Let&#8217;s take a look at the following diagram.
The CSS Box Model is a lot simpler than how it may look at first sight.  Let&#8217;s begin with the content.  Think of the content area an an empty div element. [...]]]></description>
			<content:encoded><![CDATA[<p>The <strong>CSS Box Model</strong> is essential when learning CSS to create web page layouts.  Let&#8217;s take a look at the following diagram.<br />
<div id="attachment_36" class="wp-caption alignnone" style="width: 493px"><a href="http://www.cssmaster.co.uk/wp-content/uploads/2010/01/boxmodel.jpg"><img src="http://www.cssmaster.co.uk/wp-content/uploads/2010/01/boxmodel.jpg" alt="CSS Box Model" title="CSS Box Model" width="483" height="250" class="size-full wp-image-36" /></a><p class="wp-caption-text">CSS Box Model</p></div></p>
<p>The <strong>CSS Box Model</strong> is a lot simpler than how it may look at first sight.  Let&#8217;s begin with the content.  Think of the content area an an empty div element.  You add your content to it as you normally would.<br />
<code>&lt;div class="my_div"&gt;Some content here&lt;/div&gt;</p>
<p>.my_div{ }</code></p>
<p>Simple.  Now let&#8217;s add some padding.<br />
<code>.my_div { padding:10px; }</code><br />
Now the content in the div is pushed in 10 pixels in every direction (top, bottom, left and right), making it 20 pixels higher (top AND bottom) and 20 pixels wider (left AND right).  This is represented in the above diagram.</p>
<p>Now we can add a border to the content.<br />
<code>.my_div {<br />
&nbsp;&nbsp;padding:10px;<br />
&nbsp;&nbsp;border:10px solid green;<br />
}</code><br />
This adds a 10 pixel green border all the way around the div element.  Assuming that the original div is 100px high and 100px wide it is now:<br />
100&#215;100px + 20&#215;20px (padding) + 20&#215;20px (border).  Remember that the border takes up 10 pixels on the left AND right, aswell as the top AND bottom, meaning 20px height and 20px wide.</p>
<p>And finally we have the margin.  The margin doesn&#8217;t add any size to the div itself but instead spaces it out away from other elements.  Imagine margin to be identical to padding but on the outside of the box.  If we add 10 pixels of margin it will add 10 pixels to every side of the box, making the box 20 pixels wider, and 20 pixels higher.  </p>
<p>So let&#8217;s summarise, a 100px box, with 10px padding, 10px border and 10px margin:<br />
<code>.my_div {<br />
&nbsp;&nbsp;padding:10px;<br />
&nbsp;&nbsp;border:10px solid green;<br />
&nbsp;&nbsp;margin:10px;<br />
}</code><br />
Will be 100px + 20px + 20px + 20px = 160px.</p>
<p>The <strong>CSS Box Model</strong> is a very important and simple theory to master before starting a</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cssmaster.co.uk/css-box-model/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

