<?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>csslearn.com &#187; CSS shorthand</title>
	<atom:link href="http://csslearn.com/tag/css-shorthand/feed" rel="self" type="application/rss+xml" />
	<link>http://csslearn.com</link>
	<description>learn style with style</description>
	<lastBuildDate>Mon, 01 Mar 2010 02:17:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Working with CSS shorthand for boxes</title>
		<link>http://csslearn.com/working-with-css-shorthand-for-boxes</link>
		<comments>http://csslearn.com/working-with-css-shorthand-for-boxes#comments</comments>
		<pubDate>Tue, 24 Nov 2009 18:57:28 +0000</pubDate>
		<dc:creator>kunal</dc:creator>
				<category><![CDATA[CSS Basic]]></category>
		<category><![CDATA[CSS shorthand]]></category>
		<category><![CDATA[CSS Turtorial]]></category>

		<guid isPermaLink="false">http://csslearn.com/?p=42</guid>
		<description><![CDATA[This is something that is useful to get to grips with, in order to create the most efficient and easy-to-update CSS.
The previous example showed how to set all margins and padding values to 0, and this was done in shorthand instead of writing out every single value. How CSS shorthand works for boxes is like [...]


Related posts:<ol><li><a href='http://csslearn.com/using-shorthand-properties-in-css' rel='bookmark' title='Permanent Link: Using Shorthand Properties in CSS'>Using Shorthand Properties in CSS</a> <small>Your body rule should now look like this: body {...</small></li>
<li><a href='http://csslearn.com/css-shorthand-for-font-properties' rel='bookmark' title='Permanent Link: CSS shorthand for font properties'>CSS shorthand for font properties</a> <small>The CSS properties discussed so far can be written in...</small></li>
<li><a href='http://csslearn.com/list-margins-and-padding' rel='bookmark' title='Permanent Link: List margins and padding'>List margins and padding</a> <small>Browsers don’t seem to be able to agree on how...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>This is something that is useful to get to grips with, in order to create the most efficient and easy-to-update CSS.<br />
The previous example showed how to set all margins and padding values to 0, and this was done in shorthand instead of writing out every single value. How CSS shorthand works for boxes is like this:<br />
A single value (margin: 10px;): This is applied to all edges. Two values (margin: 10px 20px;): The first setting (10px) is applied to the top and bottom edges. The second setting (20px) is applied to both the left and right edges<br />
(20px each, not in total). Three values (margin: 10px 20px 30px;): The first setting (10px) is applied to the<br />
top edge. The second setting (20px) is applied to both the left and right edges. The third setting (30px) is applied to the bottom edge.<br />
Four settings (margin: 10px 20px 30px 40px;): Settings are applied clockwise from the top (i.e., top: 10px; right: 20px; bottom: 30px; left: 40px). Shorthand’s benefits become obvious when comparing CSS shorthand with the equivalent<br />
properties and values written out in full. For instance, the following shorthand</p>
<p>#box {<br />
margin: 0;<br />
padding: 0 100px;<br />
}<br />
looks like this when written out in full:<br />
#box {<br />
margin-top: 0;<br />
margin-right: 0;<br />
margin-bottom: 0;<br />
margin-left: 0;<br />
padding-top: 0;<br />
padding-right: 100px;<br />
padding-bottom: 0;<br />
padding-left: 100px;<br />
}<br />
Whether or not you use shorthand is up to you. Some designers swear by it and others because of it. Some web design applications have options to “force” shorthand or avoid it entirely. I reckon it’s a good thing: CSS documents are usually more logical and shorter because of shorthand. But if you don’t agree, feel free to keep on defining margins and<br />
padding as relevant for every edge of every element.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fcsslearn.com%2Fworking-with-css-shorthand-for-boxes&amp;linkname=Working%20with%20CSS%20shorthand%20for%20boxes"><img src="http://csslearn.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://csslearn.com/using-shorthand-properties-in-css' rel='bookmark' title='Permanent Link: Using Shorthand Properties in CSS'>Using Shorthand Properties in CSS</a> <small>Your body rule should now look like this: body {...</small></li>
<li><a href='http://csslearn.com/css-shorthand-for-font-properties' rel='bookmark' title='Permanent Link: CSS shorthand for font properties'>CSS shorthand for font properties</a> <small>The CSS properties discussed so far can be written in...</small></li>
<li><a href='http://csslearn.com/list-margins-and-padding' rel='bookmark' title='Permanent Link: List margins and padding'>List margins and padding</a> <small>Browsers don’t seem to be able to agree on how...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://csslearn.com/working-with-css-shorthand-for-boxes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
