<?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>Frog&#039;s Digital Design Blog &#187; css tricks</title>
	<atom:link href="http://www.thefloatingfrog.co.uk/tag/css-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thefloatingfrog.co.uk</link>
	<description>Design, Photography, Internet and Geek related</description>
	<lastBuildDate>Wed, 09 Nov 2011 09:34:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>The CSS Bible &#8211; CSS is your God!</title>
		<link>http://www.thefloatingfrog.co.uk/tips-tricks-tutorials/the-css-bible-css-is-your-god/</link>
		<comments>http://www.thefloatingfrog.co.uk/tips-tricks-tutorials/the-css-bible-css-is-your-god/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 19:26:27 +0000</pubDate>
		<dc:creator>Gary Hartley</dc:creator>
				<category><![CDATA[News & Reviews]]></category>
		<category><![CDATA[Tips, Tricks & Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[css box model]]></category>
		<category><![CDATA[css for beginners]]></category>
		<category><![CDATA[css shorthand]]></category>
		<category><![CDATA[css techniques]]></category>
		<category><![CDATA[css tricks]]></category>

		<guid isPermaLink="false">http://www.thefloatingfrog.co.uk/?p=2574</guid>
		<description><![CDATA[Here you go, a stellar assortment of CSS related links for you to reference. If you&#8217;re a CSS beginner or even a CSS guru we&#8217;re sure there is something here for everyone, enjoy! The CSS Box Model CSS linky link craziness 5 Tips For Organising Your CSS: http://bit.ly/2ytHwr 5 Popular CSS Frameworks + Tutorials &#38; [...]


Related posts:<ol><li><a href='http://www.thefloatingfrog.co.uk/web-design/your-css-framework-needs-you/' rel='bookmark' title='Permanent Link: Your CSS framework needs you!'>Your CSS framework needs you!</a></li>
<li><a href='http://www.thefloatingfrog.co.uk/web-design/css-news-a-quick-catchup/' rel='bookmark' title='Permanent Link: CSS NEWS &#8211; A quick catchup'>CSS NEWS &#8211; A quick catchup</a></li>
<li><a href='http://www.thefloatingfrog.co.uk/web-design/10-css-shorthand-techniques-youll-use-everyday/' rel='bookmark' title='Permanent Link: 10 CSS shorthand techniques you&#8217;ll use everyday'>10 CSS shorthand techniques you&#8217;ll use everyday</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here you go, a stellar assortment of CSS related links for you to reference. If you&#8217;re a CSS beginner or even a CSS guru we&#8217;re sure there is something here for everyone, enjoy!</p>
<h2>The CSS Box Model</h2>
<p><img src="http://www.thefloatingfrog.co.uk/wp-content/uploads/2008/10/css-box-model.jpg" alt="CSS Box Model" /></p>
<h2>CSS linky link craziness</h2>
<div class="block">
<ul>
<li>5 Tips For Organising Your CSS: <a rel="nofollow" href="http://bit.ly/2ytHwr" target="_blank">http://bit.ly/2ytHwr</a></li>
<li>5 Popular CSS Frameworks + Tutorials &amp; Tools for Getting Started: <a rel="nofollow" href="http://bit.ly/iwt5" target="_blank">http://bit.ly/iwt5</a></li>
<li>5 Ways to Instantly Write Better CSS: <a rel="nofollow" href="http://bit.ly/im8K5" target="_blank">http://bit.ly/im8K5</a></li>
<li>8 Premium One Line CSS Tips: <a rel="nofollow" href="http://bit.ly/pUaM" target="_blank">http://bit.ly/pUaM</a></li>
<li>8 CSS tips for better linking: <a rel="nofollow" href="http://bit.ly/KAbAX" target="_blank">http://bit.ly/KAbAX</a></li>
<li>10 CSS tricks you may not know: <a rel="nofollow" href="http://bit.ly/QN2I4" target="_blank">http://bit.ly/QN2I4</a></li>
<li>10 CSS shorthand techniques you’ll use everyday: <a href="http://bit.ly/2IBO2g" target="_blank">http://bit.ly/2IBO2g</a></li>
<li>10 CSS Tips For Sexy Stylesheets: <a rel="nofollow" href="http://bit.ly/12KkvT" target="_blank">http://bit.ly/12KkvT</a></li>
<li>10 Swish And Stylish CSS Tricks: <a rel="nofollow" href="http://bit.ly/4s5vsF" target="_blank">http://bit.ly/4s5vsF</a></li>
<li>10 CSS buttons tutorial list: <a rel="nofollow" href="http://bit.ly/GOQi" target="_blank">http://bit.ly/GOQi</a></li>
<li>10 Excellent CSS Tips and Tutorials: <a rel="nofollow" href="http://bit.ly/wlkhA" target="_blank">http://bit.ly/wlkhA</a></li>
<li>10 Principles of the CSS Masters: <a rel="nofollow" href="http://bit.ly/WzxKI" target="_blank">http://bit.ly/WzxKI</a></li>
<li>12 CSS Tools and Tutorials for Beautiful Web Typography: <a rel="nofollow" href="http://bit.ly/oAc8S" target="_blank">http://bit.ly/oAc8S</a></li>
<li>12 Most Used CSS Tricks: <a rel="nofollow" href="http://bit.ly/vv7lT" target="_blank">http://bit.ly/vv7lT</a></li>
<li>12 Principles For Keeping Your Code Clean: <a rel="nofollow" href="http://bit.ly/N5Nad" target="_blank">http://bit.ly/N5Nad</a></li>
<li>13 Training Principles of CSS Everyone Should Know: <a rel="nofollow" href="http://bit.ly/M88uB" target="_blank">http://bit.ly/M88uB</a></li>
<li>15 CSS Properties You Probably Never Use (but perhaps should): <a rel="nofollow" href="http://bit.ly/daM4H" target="_blank">http://bit.ly/daM4H</a></li>
<li>15 CSS Tricks That Must be Learned: <a rel="nofollow" href="http://bit.ly/1Eymas" target="_blank">http://bit.ly/1Eymas</a></li>
<li>16 Usable CSS Graph and Bar Chart Tutorials and Techniques: <a rel="nofollow" href="http://bit.ly/4B2qX" target="_blank">http://bit.ly/4B2qX</a></li>
<li>16+ Easy CSS Techniques that Simplify the Webdesigner’s Life: <a rel="nofollow" href="http://bit.ly/PReAF" target="_blank">http://bit.ly/PReAF</a></li>
<li>19 CSS Menu Tutorials to Spice Up Your Web Designs: <a rel="nofollow" href="http://bit.ly/ctqm" target="_blank">http://bit.ly/ctqm</a></li>
<li>20 Ultimate CSS Tutorials That Will Help You Master CSS: <a rel="nofollow" href="http://bit.ly/4zr6Zp" target="_blank">http://bit.ly/4zr6Zp</a></li>
<li>20 Useful CSS Tips For Beginners: <a rel="nofollow" href="http://bit.ly/9u0Y3" target="_blank">http://bit.ly/9u0Y3</a></li>
<li>25+ CSS Tools to reduce your work load: <a rel="nofollow" href="http://bit.ly/IaZ1P" target="_blank">http://bit.ly/IaZ1P</a></li>
<li>30 Excellent CSS Based Navigation and Buttons Tutorials: <a rel="nofollow" href="http://bit.ly/12sTy" target="_blank">http://bit.ly/12sTy</a></li>
<li>30+ CSS Cheat Sheets &amp; Quick Reference Guides: <a rel="nofollow" href="http://bit.ly/ne7X0" target="_blank">http://bit.ly/ne7X0</a></li>
<li>35+ Very Useful And Powerful CSS Techniques: <a rel="nofollow" href="http://bit.ly/U3KMy" target="_blank">http://bit.ly/U3KMy</a></li>
<li>40 CSS Web Form Style Tutorials For Web Developers: <a rel="nofollow" href="http://bit.ly/IMK6g" target="_blank">http://bit.ly/IMK6g</a></li>
<li>43 PSD to XHTML, CSS Tutorials Creating Web Layouts And Navigation: <a rel="nofollow" href="http://bit.ly/yqiOG" target="_blank">http://bit.ly/yqiOG</a></li>
<li>50+ Nice Clean CSS Tab-Based Navigation Scripts: <a rel="nofollow" href="http://bit.ly/14T9b1" target="_blank">http://bit.ly/14T9b1</a></li>
<li>53 CSS-Techniques You Couldn’t Live Without: <a rel="nofollow" href="http://bit.ly/Jq3" target="_blank">http://bit.ly/Jq3</a></li>
<li>60+ Wacky CSS resources &#8211; Tutorials, Layouts, Optimizers, Editors &amp; more: <a rel="nofollow" href="http://bit.ly/2TNXG" target="_blank">http://bit.ly/2TNXG</a></li>
<li>70 Expert Ideas For Better CSS Coding: <a rel="nofollow" href="http://bit.ly/3R7uuZ" target="_blank">http://bit.ly/3R7uuZ</a></li>
<li>101 CSS Techniques Of All Time: <a rel="nofollow" href="http://bit.ly/Aomz" target="_blank">http://bit.ly/Aomz</a></li>
<li>101 CSS Tips, Tutorials and Examples: <a rel="nofollow" href="http://bit.ly/iyHpQ" target="_blank">http://bit.ly/iyHpQ</a></li>
<li>120 Excellent Examples of CSS Horizontal Menus: <a rel="nofollow" href="http://bit.ly/13dPWf" target="_blank">http://bit.ly/13dPWf</a></li>
<li>CSS Cheat Sheet: <a rel="nofollow" href="http://bit.ly/kLz8v" target="_blank">http://bit.ly/kLz8v</a></li>
<li>Web Design + Tips and advice on web standards development (Covers CSS): <a rel="nofollow" href="http://bit.ly/qd9pP" target="_blank">http://bit.ly/qd9pP</a></li>
<li>Resetting Your Styles with CSS Reset: <a rel="nofollow" href="http://bit.ly/15hzcl" target="_blank">http://bit.ly/15hzcl</a></li>
<li>Creating CSS Layouts: The Best Tutorials on Converting PSD to XHTML: <a rel="nofollow" href="http://bit.ly/riyH7" target="_blank">http://bit.ly/riyH7</a></li>
<li>Five web 2.0 CSS menu tutorials: <a rel="nofollow" href="http://bit.ly/2GjBNn" target="_blank">http://bit.ly/2GjBNn</a></li>
<li>Innovative (and Experimental) CSS Examples and Techniques: <a rel="nofollow" href="http://bit.ly/BKft" target="_blank">http://bit.ly/BKft</a></li>
<li>Quick &amp; Easy CSS Development with Firebug: <a rel="nofollow" href="http://bit.ly/37CBoB" target="_blank">http://bit.ly/37CBoB</a></li>
<li>CSS Layouts: 40+ Tutorials, Tips, Demos and Best Practices: <a rel="nofollow" href="http://bit.ly/eegK" target="_blank">http://bit.ly/eegK</a></li>
<li>CSS Basics &#8211; Class Vs #ID&#8217;s: <a rel="nofollow" href="http://tinyurl.com/8efu6n" target="_blank">http://tinyurl.com/8efu6n</a></li>
<li>CSS Code Snippets: 15 Wicked Tricks &#8211; <a rel="nofollow" href="http://bit.ly/Xs962" target="_blank">http://bit.ly/Xs962</a></li>
<li>Using CSS to Do Anything: 50+ Creative Examples and Tutorials: <a rel="nofollow" href="http://bit.ly/KTFXG" target="_blank">http://bit.ly/KTFXG</a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://www.thefloatingfrog.co.uk/web-design/your-css-framework-needs-you/' rel='bookmark' title='Permanent Link: Your CSS framework needs you!'>Your CSS framework needs you!</a></li>
<li><a href='http://www.thefloatingfrog.co.uk/web-design/css-news-a-quick-catchup/' rel='bookmark' title='Permanent Link: CSS NEWS &#8211; A quick catchup'>CSS NEWS &#8211; A quick catchup</a></li>
<li><a href='http://www.thefloatingfrog.co.uk/web-design/10-css-shorthand-techniques-youll-use-everyday/' rel='bookmark' title='Permanent Link: 10 CSS shorthand techniques you&#8217;ll use everyday'>10 CSS shorthand techniques you&#8217;ll use everyday</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thefloatingfrog.co.uk/tips-tricks-tutorials/the-css-bible-css-is-your-god/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS NEWS &#8211; A quick catchup</title>
		<link>http://www.thefloatingfrog.co.uk/web-design/css-news-a-quick-catchup/</link>
		<comments>http://www.thefloatingfrog.co.uk/web-design/css-news-a-quick-catchup/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 12:32:42 +0000</pubDate>
		<dc:creator>Gary Hartley</dc:creator>
				<category><![CDATA[News & Reviews]]></category>
		<category><![CDATA[Tips, Tricks & Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[css compression]]></category>
		<category><![CDATA[css techniques]]></category>
		<category><![CDATA[css tricks]]></category>

		<guid isPermaLink="false">http://www.thefloatingfrog.co.uk/frog-blog/?p=1851</guid>
		<description><![CDATA[Some CSS news from the web design industry. I have cherry-picked these articles and tools, aimed specifically at CSS and web design. Enjoy! My Top 10 Most Used CSS Class Names Many developers are puzzled when it comes to assigning class names to elements and often end up using wrong ones. Class names should not [...]


Related posts:<ol><li><a href='http://www.thefloatingfrog.co.uk/web-design/your-css-framework-needs-you/' rel='bookmark' title='Permanent Link: Your CSS framework needs you!'>Your CSS framework needs you!</a></li>
<li><a href='http://www.thefloatingfrog.co.uk/web-design/css-box-model-hierarchi/' rel='bookmark' title='Permanent Link: CSS Box Model Hierarchi'>CSS Box Model Hierarchi</a></li>
<li><a href='http://www.thefloatingfrog.co.uk/web-design/css-for-absolute-beginners-a-slideshow-walk-through-starting-with-the-basics/' rel='bookmark' title='Permanent Link: CSS for ABSOLUTE BEGINNERS &#8211; shaping up with CSS'>CSS for ABSOLUTE BEGINNERS &#8211; shaping up with CSS</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><!--digg-->Some CSS news from the web design industry. I have cherry-picked these articles and tools, aimed specifically at CSS and web design. Enjoy!</p>
<h3><a href="http://cssglobe.com/post/3745/my-top-10-most-used-css-class-names">My Top 10 Most Used CSS Class Names</a></h3>
<p>Many developers are puzzled when it comes to assigning class names to elements and often end up using wrong ones. Class names should not describe how the element looks like or where is it placed. A good class name should describe what a certain element represents. Here are my top 10 class names with explanations. Hopefully it will give you a clearer image of what kind of class names you should use. <a href="http://cssglobe.com/post/3745/my-top-10-most-used-css-class-names">Read more&#8230;</a></p>
<h3><a href="http://cssorgy.com/9-css-frameworks-for-faster-templates-building-387">9 CSS frameworks for faster templates building</a></h3>
<p>Frameworks are already widely used for Javascript or PHP development, and it is getting popular for CSS templating. It improves your workflow and lets you set up templates quickly with cross-browser compatibility in mind. Here is nine frameworks to make templating faster. <a href="http://cssorgy.com/9-css-frameworks-for-faster-templates-building-387">Read more&#8230;</a></p>
<h3><a href="http://woork.blogspot.com/2009/01/woork-handbook.html">The Woork Handbook</a></h3>
<p>The Woork Handbook is a free eBook about CSS, HTML, Ajax, web programming, Mootools, Scriptaculous and other topics about web design&#8230; directly from Woork! <a href="http://woork.blogspot.com/2009/01/woork-handbook.html">Read more&#8230;</a></p>
<h3><a href="http://woork.blogspot.com/2008/12/useful-resources-to-improve-look-and.html">Useful resources to improve the look and features of HTML Forms</a></h3>
<p>Are you looking for some useful tips to improve the look and features of your standard HTML FORM elements? In this post I suggest you some interesting resources about this topics. <a href="http://woork.blogspot.com/2008/12/useful-resources-to-improve-look-and.html">Read more&#8230;</a></p>
<h3><a href="http://woork.blogspot.com/2008/11/useful-guidelines-to-improve-css-coding.html">Useful guidelines to improve CSS coding and maintainability</a></h3>
<p>Developing CSS code for websites with a complex layout structure can be an hard work for a web designer. But in this situation, an harder work is writing code in order to simplify the continuous maintainability process. <a href="http://woork.blogspot.com/2008/11/useful-guidelines-to-improve-css-coding.html">Read more&#8230;</a></p>
<h3><a href="http://woork.blogspot.com/2008/11/css-coding-semantic-approach-in-naming.html">CSS coding: semantic approach in naming convention</a></h3>
<p>Naming convention in CSS coding is an &#8220;hot&#8221; discussion topic. In this post I want to illustrate some suggests and guidelines to use a semantic approach instead of a structural approach in naming CSS classes, analyzing the essential elements of a popular 3 column layout. <a href="">Read more&#8230;</a></p>
<h3><a href="http://cssglobe.com/post/3028/creating-easy-and-useful-css-sprites">Creating easy and useful CSS Sprites</a></h3>
<p>CSS sprites are a way to combine images to improve our page loading time, reducing the number of requests our server does. In this article I will teach you how to make them. <a href="http://cssglobe.com/post/3028/creating-easy-and-useful-css-sprites">Read more&#8230;</a></p>
<h3><a href="http://isnoop.net/tools/css.php">CSS SuperScrub </a></h3>
<p>This tool can significantly reduce the size and complexity of your CSS by programmatically stripping unneeded content, stripping redundant calls, and intelligently grouping the remaining element names.  <a href="http://isnoop.net/tools/css.php">Read more&#8230;</a></p>


<p>Related posts:<ol><li><a href='http://www.thefloatingfrog.co.uk/web-design/your-css-framework-needs-you/' rel='bookmark' title='Permanent Link: Your CSS framework needs you!'>Your CSS framework needs you!</a></li>
<li><a href='http://www.thefloatingfrog.co.uk/web-design/css-box-model-hierarchi/' rel='bookmark' title='Permanent Link: CSS Box Model Hierarchi'>CSS Box Model Hierarchi</a></li>
<li><a href='http://www.thefloatingfrog.co.uk/web-design/css-for-absolute-beginners-a-slideshow-walk-through-starting-with-the-basics/' rel='bookmark' title='Permanent Link: CSS for ABSOLUTE BEGINNERS &#8211; shaping up with CSS'>CSS for ABSOLUTE BEGINNERS &#8211; shaping up with CSS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thefloatingfrog.co.uk/web-design/css-news-a-quick-catchup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>10 CSS shorthand techniques you&#8217;ll use everyday</title>
		<link>http://www.thefloatingfrog.co.uk/web-design/10-css-shorthand-techniques-youll-use-everyday/</link>
		<comments>http://www.thefloatingfrog.co.uk/web-design/10-css-shorthand-techniques-youll-use-everyday/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 12:20:09 +0000</pubDate>
		<dc:creator>Gary Hartley</dc:creator>
				<category><![CDATA[Tips, Tricks & Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cascading style sheets]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[css shorthand]]></category>
		<category><![CDATA[css techniques]]></category>
		<category><![CDATA[css tricks]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[shrink css]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.thefloatingfrog.co.uk/frog-blog/?p=871</guid>
		<description><![CDATA[CSS shortland is a technique of writing mulitple declarations and values in a single line of CSS code. The advantages of using shorthand is to primarily reduce the CSS file size, but there are other benefits. A bloated and disorganised stylesheet can be hard to debug if you encounter problems, especially if you wrote it [...]


Related posts:<ol><li><a href='http://www.thefloatingfrog.co.uk/competitions/hdr-photography-competition-winners-announced/' rel='bookmark' title='Permanent Link: HDR Photography Competition: Winners Announced!'>HDR Photography Competition: Winners Announced!</a></li>
<li><a href='http://www.thefloatingfrog.co.uk/web-design/css-for-absolute-beginners-a-slideshow-walk-through-starting-with-the-basics/' rel='bookmark' title='Permanent Link: CSS for ABSOLUTE BEGINNERS &#8211; shaping up with CSS'>CSS for ABSOLUTE BEGINNERS &#8211; shaping up with CSS</a></li>
<li><a href='http://www.thefloatingfrog.co.uk/web-design/css-news-a-quick-catchup/' rel='bookmark' title='Permanent Link: CSS NEWS &#8211; A quick catchup'>CSS NEWS &#8211; A quick catchup</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-890" title="10 CSS shorthand techniques you'll use everyday" src="http://www.thefloatingfrog.co.uk/frog-blog/wp-content/uploads/2008/09/fat_hero.gif" alt="10 CSS shorthand techniques you'll use everyday" width="250" height="338" /></p>
<p><!--digg-->CSS shortland is a technique of writing mulitple declarations and values in a single line of CSS code. The advantages of using shorthand is to primarily reduce the CSS file size, but there are other benefits. A bloated and disorganised stylesheet can be hard to debug if you encounter problems, especially if you wrote it and another unfortunate colleage has to fix it while your away sunning it in some hot climate.</p>
<p>To make it easy we&#8217;ll look at the most commonly used CSS declarations, write them in longhand, then sprinkle our magic, resulting in a neat, short line of code.</p>
<p><strong>There are many permutations you can use with each declaration and using them all in an example would be a headache, so we&#8217;ll pick one, then simplify that, hopefully giving you a flavor of CSS shorthand.</strong></p>
<h2>0 values</h2>
<p>The golden rule is if the value is 0 you don&#8217;t have to specify the unit (px/em/%). You may write:</p>
<pre>01|  padding: 10px 5px 0px 0px;</pre>
<p>try</p>
<pre class="highlightpre">01|  padding: 10px 5px 0 0;</pre>
<h2>Remove Selectors</h2>
<p>A selector is basically the element you&#8217;re applying the styling to, for instance h1, h2, h2, div, strong, pre, ul, ol etc.. If your using a class (.classname) or an ID (#idname) you don&#8217;t need to include the selector within your declaration.</p>
<pre>01|  div#logowrap</pre>
<p>let&#8217;s lose the selector from within this CSS declaration</p>
<pre class="highlightpre">01|  #logowrap</pre>
<p>So the selector in this case was <code>div</code></p>
<h2>* is the joker in the pack</h2>
<p>Use * wisely in CSS as it&#8217;s a firey little monkey. * is a wildcard declaration, you can use it to set a group of declarations to all or parts of your design, for example:</p>
<pre class="highlightpre">01|  * {
02|  margin: 0;
03|  }</pre>
<p>This declaration would set the margin to zero on every element on your page. Alternatively, set this wildcard with an element, such as:</p>
<pre class="highlightpre">01|  #menu * {
02|  margin: 0;
03|  }</pre>
<p>This declaration would set the margin to zero on every element within #menu.</p>
<h2>Backgrounds</h2>
<p>Background properties include the ability to set a colour, an image, image position and image repetition. You could write:</p>
<pre>01|  background-image: url("logo.png");
02|  background-position: top center;
03|  background-repeat: no-repeat;</pre>
<p>Becomes</p>
<pre class="highlightpre">01|  background: url(logo.png) no-repeat top center;</pre>
<h2>Colours</h2>
<p>The most common way of specifying a colour in CSS is to use <strong>hexadecimal</strong> notation: a (#) followed by six digits. One great shortcut that many don’t know about is that when a colour consists of three pairs of hexadecimal digits, you can omit one digit from each pair:</p>
<p><code>#000000</code> becomes <code>#000</code>, <code>#336699</code> becomes <code>#369</code></p>
<p>This technique only works if you have three pairs, here are some examples where you can&#8217;t omit any values:</p>
<p><code>#010101, #223345, #FFF000</code></p>
<h2>Margin</h2>
<p>Apply margin to all four sides of an element like this:</p>
<pre>01|  margin-top:0px;
02|  margin-right:10px;
03|  margin-bottom:0px;
04|  margin-left:10px;</pre>
<p>Let&#8217;s simplify this even more by removing zero value prefixes and merging it into one declaration:</p>
<pre class="highlightpre">01|  margin:0 10px 0 10px;</pre>
<p>When applying padding, margin and border (and possibly a few others) you set these four values in a clockwise direction. Compare this to the hours on a clock, start with <strong>12, 3, 6, 9</strong>, all in a clockwise direction. With this in mind there is another trick to slim this declaration down. Look out for <strong>two pairs</strong>, if the <strong>top and bottom</strong> match, and the <strong>left and right</strong> match then your a winner! Omit the 3rd and 4th values. The first value represents the top and bottom value, the second represents the left and right.</p>
<p>So let&#8217;s simplify this declaration down again with the pairing technique that&#8217;s just been explained:</p>
<pre class="highlightpre">01|  margin:0 10px;</pre>
<p>The result is the element would attain margin of 10px to the left and right sides, and zero to the top and bottom. Here are a few declarations where the pairing technique can&#8217;t be applied:</p>
<h2>Padding</h2>
<p>Same principles in padding as explained in margin above.</p>
<pre>01|  padding-top:0px;
02|  padding-right:10px;
03|  padding-bottom:0px;
04|  padding-left:10px;</pre>
<p>Becomes</p>
<pre class="highlightpre">01|  padding: 0 10px;</pre>
<h2>Borders</h2>
<p>Borders are a bit more complicated since they can also have a style and a colour. To give an element a one pixel solid black border on all sides, you could write:</p>
<pre>01| border-width:1px;
02| border-style:solid;
03| border-color:#000;</pre>
<p>Becomes</p>
<pre class="highlightpre">01| border:1px solid #000;</pre>
<p>I typically write in order of width style color.</p>
<p>We can also set different widths on all four sides of the box element by writing:</p>
<pre>01| border-top-width:1px;
02| border-right-width:2px;
03| border-bottom-width:3px;
04| border-left-width:4px;</pre>
<p>The CSS shorthand for this would be:</p>
<pre class="highlightpre">01| border-width:1px 2px 3px 4px;</pre>
<p>Finally we could style just the left and right like this</p>
<pre>01| border-right:1px solid #000;
02| border-bottom:1px solid #000;</pre>
<p>This would be</p>
<pre class="highlightpre">01| border:1px solid #000;
02| border-width:0 1px 1px 0;</pre>
<p>Set a default style for all four sides then overwrite the widths below.</p>
<h2>Fonts</h2>
<p>There are many properties for font, just like the background properties. In a complex string you may write:</p>
<pre>01| font-style:italic;
02| font-variant:small-caps;
03| font-weight:bold;
04| font-size:1em;
05| line-height:150%;
06| font-family:Verdana, Arial, sans-serif;</pre>
<p>You could write</p>
<pre class="highlightpre">01| font:italic small-caps bold 1em/150% Verdana, Arial, sans-serif;</pre>
<h2>Lists</h2>
<pre>01| list-style-type:square;
02| list-style-position:inside;
03| list-style-image:url(filename.gif);</pre>
<p>And finally</p>
<pre class="highlightpre">01| list-style:square inside url(filename.gif);</pre>
<p>Credit to <a href="http://www.456bereastreet.com/archive/200502/efficient_css_with_shorthand_properties/">456bereastreet</a> for the inspiration to write this useful 10 shorthand CSS tips.</p>
<p>If you want to <strong>download</strong> a quick reference guide in PDF you can by <a href="http://www.leigeber.com/wp-content/uploads/2008/04/css-cheat-sheet.pdf" target="_blank">clicking this link</a>.</p>


<p>Related posts:<ol><li><a href='http://www.thefloatingfrog.co.uk/competitions/hdr-photography-competition-winners-announced/' rel='bookmark' title='Permanent Link: HDR Photography Competition: Winners Announced!'>HDR Photography Competition: Winners Announced!</a></li>
<li><a href='http://www.thefloatingfrog.co.uk/web-design/css-for-absolute-beginners-a-slideshow-walk-through-starting-with-the-basics/' rel='bookmark' title='Permanent Link: CSS for ABSOLUTE BEGINNERS &#8211; shaping up with CSS'>CSS for ABSOLUTE BEGINNERS &#8211; shaping up with CSS</a></li>
<li><a href='http://www.thefloatingfrog.co.uk/web-design/css-news-a-quick-catchup/' rel='bookmark' title='Permanent Link: CSS NEWS &#8211; A quick catchup'>CSS NEWS &#8211; A quick catchup</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thefloatingfrog.co.uk/web-design/10-css-shorthand-techniques-youll-use-everyday/feed/</wfw:commentRss>
		<slash:comments>59</slash:comments>
		</item>
	</channel>
</rss>

