<?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>Design Shack &#187; origin</title>
	<atom:link href="http://designshack.net/tag/origin/feed" rel="self" type="application/rss+xml" />
	<link>http://designshack.net</link>
	<description>Inspiration, CSS Gallery &#38; Community News</description>
	<lastBuildDate>Thu, 09 Feb 2012 06:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Introduction to CSS3 &#8211; Part 6: Backgrounds</title>
		<link>http://designshack.net/articles/introduction-to-css3-part-6-backgrounds/</link>
		<comments>http://designshack.net/articles/introduction-to-css3-part-6-backgrounds/#comments</comments>
		<pubDate>Tue, 27 May 2008 16:12:35 +0000</pubDate>
		<dc:creator>David Appleyard</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[back]]></category>
		<category><![CDATA[backgrounds]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[ground]]></category>
		<category><![CDATA[multiple]]></category>
		<category><![CDATA[origin]]></category>
		<category><![CDATA[resizing]]></category>

		<guid isPermaLink="false">http://localhost:8888/?p=179</guid>
		<description><![CDATA[For the last part of our introductory series to CSS3, we will be taking a look at the new background properties. These include background size, using more than one background for an element, and background origin (which effects the position of a background). The new features allow greater control of the background element and will [...]]]></description>
			<content:encoded><![CDATA[<p>For the last part of our introductory series to CSS3, we will be taking a look at the new background properties. These include background size, using more than one background for an element, and background origin (which effects the position of a background).</p>
<p>The new features allow greater control of the background element and will provide designers with a whole array of new possibilities.  As usual, examples can be found below:</p>
<p><a href="http://www.designshack.net/tutorialexamples/css3/css3examples.html" class="smallbox">View the live examples page</a></p>
<h2>Background Size</h2>
<p>Before CSS3, background size was determined by the actual size of the image used. It will be possible with the next CSS revision to specify in terms of percentage or pixels how large a background image should be. This will allow you to re-use images in several different contexts and also expand a background to fill an area more accurately.</p>
<p>The following is a simple example of resizing the Design Shack logo as a background in the top left hand area of a div:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.backgroundsize</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">http://www.designshack.net/images/logo.gif</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
-webkit-background-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">137px</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
-khtml-background-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">137px</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
-o-background-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">137px</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
background-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">137px</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-repeat</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">60px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ddccb5</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><img src="http://www.designshack.net/postimages/backgroundresize.gif" alt="CSS3 Background Resizing" /></p>
<h2>Multiple Backgrounds</h2>
<p>The new ability to use multiple backgrounds is a great time saver, allowing you to achieve effects which previously required more than one <code>div</code>. Whether it will be possible to combine this with <code>background-size</code> will be interesting to see.</p>
<p>The example below uses one background for the top border, one repeated vertically for the left and right borders and a third at the bottom.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.multiplebackgrounds</span> <span style="color: #00AA00;">&#123;</span> 
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">270px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span> <span style="color: #933;">20px</span> <span style="color: #933;">20px</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">top.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">,</span>
<span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">bottom.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #000000; font-weight: bold;">bottom</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">,</span>
<span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">middle.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #993333;">repeat-y</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><img src="http://www.designshack.net/postimages/multiplebackgrounds.gif" alt="CSS3 Multiple Backgrounds" /></p>
<h2>Background Origin</h2>
<p>CSS3 allows you to specify how the position of a background is calculated. The <code>background-origin</code> property can be set to start positioning from either the <code>border</code>, <code>padding</code>, or <code>content</code>. This allows for greater flexibility in terms of placing a background image.</p>
<h2>In conclusion&#8230;</h2>
<p>There are a whole new variety of background options available with CSS3. As with all the other modules covered in this introductory series, it leads to greater flexibility and makes it much easier to recreate previously complex effects. Whilst not supported by most browsers as yet, it shouldn&#8217;t be too long before you can get creating stunning user interfaces with these new additions.</p>
<p>We really hope that you have enjoyed this series, and we&#8217;ll be keeping you up to date on all the latest CSS3 developments as they happen over coming months. Here&#8217;s looking forward to the next generation of style sheets!</p>
<h2>Other posts in the series</h2>
<ul>
<li><a href="http://designshack.net/tutorials/introduction-to-css3-part-1-what-is-it">Introduction to CSS3 &#8211; Part 1: What is it?</a></li>
<li><a href="http://designshack.net/tutorials/introduction-to-css3-part-2-borders">Introduction to CSS3 &#8211; Part 2: Borders</a></li>
<li><a href="http://designshack.net/tutorials/introduction-to-css3-part-3-text-effects">Introduction to CSS3 &#8211; Part 3: Text Effects</a></li>
<li><a href="http://designshack.net/tutorials/introduction-to-css3-part-4-user-interface">Introduction to CSS3 &#8211; Part 4: User Interface</a></li>
<li><a href="http://designshack.net/tutorials/introduction-to-css3-part-5-multiple-columns">Introduction to CSS3 &#8211; Part 5: Multiple Columns</a></li>
<li><a href="http://designshack.net/tutorials/introduction-to-css3-part-6-backgrounds">Introduction to CSS3 &#8211; Part 6: Backgrounds</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://designshack.net/articles/introduction-to-css3-part-6-backgrounds/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 210/219 objects using disk: basic

Served from: designshack.net @ 2012-02-09 20:07:19 -->
