<?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 Padding</title>
	<atom:link href="http://www.cssmaster.co.uk/tag/css-padding/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 Padding</title>
		<link>http://www.cssmaster.co.uk/css-padding</link>
		<comments>http://www.cssmaster.co.uk/css-padding#comments</comments>
		<pubDate>Sat, 16 Jan 2010 22:50:27 +0000</pubDate>
		<dc:creator>CSS Master</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[CSS Padding]]></category>

		<guid isPermaLink="false">http://www.cssmaster.co.uk/?p=49</guid>
		<description><![CDATA[CSS Padding is similar to CSS Margin and part of the CSS Box Model.  
Adding padding to an element will make the contents of that element move away from the outside of the element.
Take the following example:
The below div has absolutely no padding on it.

No padding

If we add 10 pixels padding:

10px padding

You can use [...]]]></description>
			<content:encoded><![CDATA[<p><strong>CSS Padding</strong> is similar to <a href="http://www.cssmaster.co.uk/css-margin">CSS Margin</a> and part of the <a href="http://www.cssmaster.co.uk/css-box-model">CSS Box Model</a>.  </p>
<p>Adding padding to an element will make the contents of that element move away from the outside of the element.</p>
<p>Take the following example:<br />
The below div has absolutely no padding on it.</p>
<div style="background-color:green;">
<div style="padding:0px;border:1px solid #000;color:#fff;">No padding</div>
</div>
<p>If we add 10 pixels padding:</p>
<div style="background-color:green;">
<div style="padding:10px;border:1px solid #000;color:#fff;">10px padding</div>
</div>
<p>You can use shorthand of: <code>padding: north east south west;</code>, as an example: <code>padding:5px 10px 5px 10px;</code>, or just <code>padding:10px;</code> to apply to all sides.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cssmaster.co.uk/css-padding/feed</wfw:commentRss>
		<slash:comments>0</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>

