<?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; gradient</title>
	<atom:link href="http://designshack.net/tag/gradient/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 2: Borders</title>
		<link>http://designshack.net/articles/introduction-to-css3-part-2-borders/</link>
		<comments>http://designshack.net/articles/introduction-to-css3-part-2-borders/#comments</comments>
		<pubDate>Wed, 07 May 2008 16:27:42 +0000</pubDate>
		<dc:creator>David Appleyard</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[borders]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[gradient]]></category>
		<category><![CDATA[rounded]]></category>

		<guid isPermaLink="false">http://localhost:8888/?p=203</guid>
		<description><![CDATA[For the second part of our series on CSS3, we&#8217;ll be taking a look at borders. Everyone who uses CSS is familiar with the border property &#8211; it&#8217;s a great way to structure content, create effects around images and improve page layout. CSS3 takes borders to a new level with the ability to use gradients, [...]]]></description>
			<content:encoded><![CDATA[<p>For the second part of our series on CSS3, we&#8217;ll be taking a look at borders. Everyone who uses CSS is familiar with the border property &#8211; it&#8217;s a great way to structure content, create effects around images and improve page layout.</p>
<p>CSS3 takes borders to a new level with the ability to use gradients, rounded corners, shadows and border images. We are going to look at each of these in a bit more detail, using examples where possible.</p>
<p>All the examples shown below can be seen at our CSS3 examples page. Many, however, can only be appreciated in the latest builds of various browsers:</p>
<p><a href="http://www.designshack.net/tutorialexamples/css3/css3examples.html" class="smallbox">View the live examples page</a></p>
<h2>Rounded Borders</h2>
<p>Achieving rounded borders using current CSS coding can be tricky &#8211; there are numerous methods available, but none are extremely straight forward. Creating individual images for each border is often needed in addition. Using CSS3, creating a rounded border is incredibly easy. It can be applied to each corner or individual corners, and the width/colour are easily altered. The CSS code is:</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;">.border_rounded</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ddccb5</span><span style="color: #00AA00;">;</span>
-moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#897048</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">310px</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/border_rounded.png" alt="Rounded CSS3 Borders" /></p>
<h2>Gradients</h2>
<p>Gradient borders can look effective if used correctly. This code is a little more complex, requiring you to define each colour of the gradient. The CSS code is:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.border_gradient</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
-moz-border-bottom-colors<span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#897048</span> <span style="color: #cc00cc;">#917953</span> <span style="color: #cc00cc;">#a18a66</span> <span style="color: #cc00cc;">#b6a488</span> <span style="color: #cc00cc;">#c5b59b</span> <span style="color: #cc00cc;">#d4c5ae</span> <span style="color: #cc00cc;">#e2d6c4</span> <span style="color: #cc00cc;">#eae1d2</span><span style="color: #00AA00;">;</span>
-moz-border-top-colors<span style="color: #00AA00;">:</span>  <span style="color: #cc00cc;">#897048</span> <span style="color: #cc00cc;">#917953</span> <span style="color: #cc00cc;">#a18a66</span> <span style="color: #cc00cc;">#b6a488</span> <span style="color: #cc00cc;">#c5b59b</span> <span style="color: #cc00cc;">#d4c5ae</span> <span style="color: #cc00cc;">#e2d6c4</span> <span style="color: #cc00cc;">#eae1d2</span><span style="color: #00AA00;">;</span>
-moz-border-left-colors<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#897048</span> <span style="color: #cc00cc;">#917953</span> <span style="color: #cc00cc;">#a18a66</span> <span style="color: #cc00cc;">#b6a488</span> <span style="color: #cc00cc;">#c5b59b</span> <span style="color: #cc00cc;">#d4c5ae</span> <span style="color: #cc00cc;">#e2d6c4</span> <span style="color: #cc00cc;">#eae1d2</span><span style="color: #00AA00;">;</span>
-moz-border-right-colors<span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#897048</span> <span style="color: #cc00cc;">#917953</span> <span style="color: #cc00cc;">#a18a66</span> <span style="color: #cc00cc;">#b6a488</span> <span style="color: #cc00cc;">#c5b59b</span> <span style="color: #cc00cc;">#d4c5ae</span> <span style="color: #cc00cc;">#e2d6c4</span> <span style="color: #cc00cc;">#eae1d2</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</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/border_gradient.png" alt="Gradient CSS3 Borders" /></p>
<h2>Box Shadows</h2>
<p>Adding a shadow to an element is difficult at present &#8211; it is a good way to differentiate a certain area, but as with any effect, it should be used sparingly. The CSS code is:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.border_shadow</span> <span style="color: #00AA00;">&#123;</span>
-webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#888</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</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/border_shadow.png" alt="Shadow CSS3 Borders" /></p>
<h2>Border Images</h2>
<p>Border images are one of the most useful additions &#8211; I&#8217;m really looking forward to discovering how people choose to use them. CSS has the ability to repeat, or stretch a border image as you choose. The CSS code is similar to the following (it varies between browsers at present):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.border_image</span> <span style="color: #00AA00;">&#123;</span>
-webkit-border-image<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">border.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #cc66cc;">27</span> <span style="color: #cc66cc;">27</span> <span style="color: #cc66cc;">27</span> <span style="color: #cc66cc;">27</span> round round<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><img src="http://www.designshack.net/postimages/border_image.png" alt="Image CSS3 Borders" /></p>
<h2>In conclusion&#8230;</h2>
<p>Borders are revolutionized! These additions in CSS3 are bound to save you a huge amount of time as a designer. They go a long way towards simplifying layouts and allow you to create visually appealing boxes without even opening Photoshop.</p>
<p>The next article in this series will be expanding on a new area in CSS3, Text Effects. Remember, to see live examples of these features, take a look at our <a href="http://www.designshack.net/tutorialexamples/css3/css3examples.html">CSS3 example page</a>.</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-2-borders/feed/</wfw:commentRss>
		<slash:comments>44</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 199/223 objects using disk: basic

Served from: designshack.net @ 2012-02-09 17:16:46 -->
