<?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>Kyle Schaeffer - Web Design and SharePoint Branding &#187; Corners</title>
	<atom:link href="http://kyleschaeffer.com/tag/corners/feed/" rel="self" type="application/rss+xml" />
	<link>http://kyleschaeffer.com</link>
	<description>Web Design &#38; SharePoint Branding</description>
	<lastBuildDate>Wed, 01 Feb 2012 23:01:50 +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>IE Corner Inserts via jQuery</title>
		<link>http://kyleschaeffer.com/tutorials/ie-corner-inserts-via-jquery/</link>
		<comments>http://kyleschaeffer.com/tutorials/ie-corner-inserts-via-jquery/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 22:51:43 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Corners]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.kyleschaeffer.com/?p=422</guid>
		<description><![CDATA[I recently had a client whose design demanded rounded corners in a lot of different areas of their site. As I looked through the design documentation, the variety and color of these rounded widgets really started to add up. I &#8230; <a href="http://kyleschaeffer.com/tutorials/ie-corner-inserts-via-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently had a client whose design demanded rounded corners in a lot of different areas of their site. As I looked through the design documentation, the variety and color of these rounded widgets really started to add up. I quickly decided that <a href="http://www.kyleschaeffer.com/best-practices/rounded-corners-in-mozilla-and-safari/">pure CSS corners</a> were the best choice for their design. Most users can utilize <code>border-radius</code> to apply the rounded effect without any overhead (the browser does the work), and the remaining users can be handled by a quick and easy bit of jQuery.<span id="more-422"></span></p>
<h2>For the (better) browsers&#8230;</h2>
<p>It&#8217;s easy to add corners to your design in most browsers. In a previous post, I talked about the different ways to apply CSS corners within your design. Here&#8217;s what I used for this particular client.</p>
<div id="the-css">
<pre>.corners {
	-moz-border-radius: 12px;
	-webkit-border-radius: 12px;
}
.noTL {
	-moz-border-radius-topleft: 0;
	-webkit-border-top-left-radius: 0;
}
.noTR {
	-moz-border-radius-topright: 0;
	-webkit-border-top-right-radius: 0;
}
.noBL {
	-moz-border-radius-bottomleft: 0;
	-webkit-border-bottom-left-radius: 0;
}
.noBR {
	-moz-border-radius-bottomright: 0;
	-webkit-border-bottom-right-radius: 0;
}</pre>
</div>
<p>This made it extremely easy to add corners to the elements in my design. In most cases, I could simply add <code>&lt;div class=&quot;myDivClass <strong>corners</strong>&quot;/&gt;</code>, and the CSS does the rest. If I don&#8217;t want a rounded edge on a particular corner, I can just add <code>noTR</code>, <code>noBL</code>, etc. to my class list. Easy.</p>
<h2>For the other (not-so-better) browser&#8230;</h2>
<p><strong>Disclaimer:</strong> this really doesn&#8217;t do anything entirely too amazing. It&#8217;s not auto-magically generating corner images, and it&#8217;s not inserting a ton of HTML to simulate corner images (I just hate when scripts do that). This is a script I have been using for a while to add corners for IE users; basically, it builds a custom image path for each style of widget in your design marked with the <code>corners</code> CSS class. For each corners widget that my script finds, it will trace up through your HTML until it finds a parent element with a <code>background-color</code>. It then creates four <code>&lt;div/&gt;</code> tags inside your widget and positions them at the outer corners of the widget. The background-image for these <code>&lt;div/&gt;</code> tags is set to something like <strong>corners-12-ffffff.png</strong> or <strong>corners-12-ffaa10-border</strong> (if your widget has a border-width associated with it). The <code>12</code> is the radius of your corner, and <code>ffffff</code> is the background color that appears behind your widget. You&#8217;ll have to create the images yourself (and put them in the right place), but my script will handle inserting the HTML and CSS in the right place. If you create the images <a href="http://www.kyleschaeffer.com/best-practices/reusable-transparent-css-rounded-corners/">a little like this</a>, then you&#8217;ll find that your IE corners will be in place in no time at all.</p>
<p>It&#8217;s certainly not ground-breaking stuff, but it makes it very easy to reduce the overhead in your design for most users. In addition, the script is fairly small, and you&#8217;ll find it&#8217;s really not much overhead for IE users as well. Here&#8217;s how to add it to your site:</p>
<ol>
<li>You&#8217;ll need <a href="http://jquery.com/">jQuery 1.3.2</a> or later linked to your page</li>
<li>Add the <a href="#the-css">CSS (above)</a> to your style sheet. This takes care of everyone except for IE.</li>
<li>Create a new JavaScript file with the following contents:
<pre>/*******************************************

	IE Corner Inserts v1.0

	by Kyle Schaeffer

http://www.kyleschaeffer.com

	* requires jQuery 1.3.2 or later

*******************************************/

// change this path to match the path to your corner image files
var cornerImagePathPrefix = '/designImages/';

// default file extension for corner images is PNG
var cornerImageFileExtension = '.png';

// default corner radius
var cornerRadius = '12';

$(document).ready(function(){
	$('.corners').each(function(i){
		var parentDiv = $(this).parent();
		var cornerColor = null;

		// find parent background color (trace up through DOM)
		while(cornerColor == null &amp;&amp; parentDiv != null){
			if($(parentDiv).css('background-color') != 'transparent'){
				cornerColor = $(parentDiv).css('background-color');
				cornerColor = cornerColor.substr(1);
			}
			else if($(parentDiv).hasClass('bodyWrapper')){
				cornerColor = '6f98ae';
			}
			else{
				parentDiv = $(parentDiv).parent().get(0);
			}
		}

		// apply corner &lt;div/&gt; tags to elements
		if(cornerColor != null){
			// find border offsets
			var offsetTop = parseInt($(this).css('border-top-width')) || 0;
			var offsetRight = parseInt($(this).css('border-right-width')) || 0;
			var offsetBottom = parseInt($(this).css('border-bottom-width')) || 0;
			var offsetLeft = parseInt($(this).css('border-left-width')) || 0;

			// add &quot;-border&quot; to any image path (for border-only corners)
			var borderImageText = '';
			if(offsetTop &gt; 0 &amp;&amp; offsetRight &gt; 0 &amp;&amp; offsetBottom &gt; 0 &amp;&amp; offsetLeft &gt; 0){
				borderImageText = '-border';
			}

			// change color values like &quot;#fff&quot; to &quot;#ffffff&quot;
			if(cornerColor.length == 3){
				cornerColor += cornerColor;
			}

			// set position to relative (if not already set)
			if($(this).css('position') != 'absolute' &amp;&amp; $(this).css('position') != 'relative'){
				$(this).css('position','relative');
			}

			// corner image filename
			var cornerImage = 'corners-' + cornerRadius + '-' + cornerColor + borderImageText + cornerImageFileExtension;

			// add corners
			if(!$(this).hasClass('noTL')){
				var cornerDiv = $('&lt;div style=&quot;position: absolute; height: ' + cornerRadius + 'px; width: ' + cornerRadius + 'px; background: url(' + cornerImagePathPrefix + cornerImage + ') top left no-repeat;&quot;/&gt;');
				$(cornerDiv).css('top',(offsetTop * -1) + 'px');
				$(cornerDiv).css('left',(offsetLeft * -1) + 'px');
				$(this).append(cornerDiv);
			}
			if(!$(this).hasClass('noTR')){
				var cornerDiv = $('&lt;div style=&quot;position: absolute; height: ' + cornerRadius + 'px; width: ' + cornerRadius + 'px; background: url(' + cornerImagePathPrefix + cornerImage + ') top right no-repeat;&quot;/&gt;');
				$(cornerDiv).css('top',(offsetTop * -1) + 'px');
				$(cornerDiv).css('right',(offsetRight * -1) + 'px');
				$(this).append(cornerDiv);
			}
			if(!$(this).hasClass('noBL')){
				var cornerDiv = $('&lt;div style=&quot;position: absolute; height: ' + cornerRadius + 'px; width: ' + cornerRadius + 'px; background: url(' + cornerImagePathPrefix + cornerImage + ') bottom left no-repeat;&quot;/&gt;');
				$(cornerDiv).css('bottom',(offsetBottom * -1) + 'px');
				$(cornerDiv).css('left',(offsetLeft * -1) + 'px');
				$(this).append(cornerDiv);
			}
			if(!$(this).hasClass('noBR')){
				var cornerDiv = $('&lt;div style=&quot;position: absolute; height: ' + cornerRadius + 'px; width: ' + cornerRadius + 'px; background: url(' + cornerImagePathPrefix + cornerImage + ') bottom right no-repeat;&quot;/&gt;');
				$(cornerDiv).css('bottom',(offsetBottom * -1) + 'px');
				$(cornerDiv).css('right',(offsetRight * -1) + 'px');
				$(this).append(cornerDiv);
			}
		}
	});
});

String.prototype.endsWith = function(str){
	return(this.match(str+&quot;$&quot;)==str);
}</pre>
</li>
<li>Take a look at the configuration variables near the top of the script and update if needed</li>
<li>Link to your new JS file, but make sure only IE users are loading the file:
<pre>&lt;!--[if lte IE 8]&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;/path/to/IE-Corner-Inserts.js&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt;</pre>
</li>
<li>Create your corner images and place them in the correct path on your web server. I recently made available <a href="http://www.kyleschaeffer.com/best-practices/reusable-transparent-css-rounded-corners/">a corner images Photoshop template</a> if you need help getting started.</li>
</ol>
<p>That&#8217;s it! If all goes well, you should hopefully see image-based rounded corners in Internet Explorer, as well as the more simplistic CSS-powered corners in all other browsers.</p>
]]></content:encoded>
			<wfw:commentRss>http://kyleschaeffer.com/tutorials/ie-corner-inserts-via-jquery/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Reusable Transparent CSS Rounded Corners</title>
		<link>http://kyleschaeffer.com/best-practices/reusable-transparent-css-rounded-corners/</link>
		<comments>http://kyleschaeffer.com/best-practices/reusable-transparent-css-rounded-corners/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 21:45:09 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Corners]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.kyleschaeffer.com/?p=296</guid>
		<description><![CDATA[In retrospective, there are definitely some areas where I could have improved on my Karate Corners design. I decided to take a second look and write a quick post that details how I create corners today, after almost a year &#8230; <a href="http://kyleschaeffer.com/best-practices/reusable-transparent-css-rounded-corners/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In retrospective, there are definitely some areas where I could have improved on my <a href="http://www.kyleschaeffer.com/tutorials/karate-corners-easy-rounded-corners-xhtml-no-script/">Karate Corners</a> design. I decided to take a second look and write a quick post that details how I create corners today, after almost a year of evolution in the ever-changing world of web design. This is absolutely the most simple and efficient way to create rounded corners using strictly CSS and HTML.<span id="more-296"></span></p>
<p>Rounded corners are all the rage; they have been for some time now. There are <a href="http://www.kyleschaeffer.com/best-practices/rounded-corners-in-mozilla-and-safari/">pure CSS</a> approaches to implementing this type of design, but occasionally your clients demand that your user experience be consistent across all browsers. Whether it&#8217;s time to stop using HTML and images for rounded corners is still a <a href="http://www.kyleschaeffer.com/best-practices/a-whole-new-web/">matter of debate</a>. Nonetheless, I think every designer finds themselves doing this from time to time.</p>
<h2>Say No to Images</h2>
<p>I&#8217;ve found that many designs contain various types of rounded box styles on the same page. In my previous tutorial, this would demand that you create a separate corner image for each style of box. If you have a box with a red background, you&#8217;ll need to create a corner image with red corners. That makes sense from a visual perspective. From a data perspective, however, it&#8217;s not the best approach. If you think about it, the only thing you&#8217;re really &#8220;downloading&#8221; when you download a corner image is the curvature of your box&#8217;s edge. Wouldn&#8217;t it be better if we could somehow reuse that data on every box style everywhere else in your design?</p>
<p>Well, you can! How gloriously fantastic! Well&#8230;don&#8217;t get all excited just yet. There are a few limitations to this. <strong>This will only work when your rounded box appears on a solid color.</strong> For instance, the text you&#8217;re reading right now is on a solid white background. We can easily add rounded boxes to this page because of the solid color. This doesn&#8217;t really work if your background is an image or a gradient color.</p>
<h2>Meet the Sprite</h2>
<p>So, you have a solid background color, and you&#8217;re ready to add some rounded corner boxes to your page. The only really important thing here is your corners image. In Photoshop or an image editing software of your choice, create a square image. Basically, your image is all four box corners stuck together, so make it symmetrical. Fill your image with the background color of your page, and then delete a circle out of the middle of the square. It&#8217;s that easy! Here&#8217;s what it should look like when you&#8217;re done:</p>
<p><img src="http://kyleschaeffer.com/wordpress/wp-content/uploads/2009/09/TransparentCorners.png" alt="Transparent Corners Image" /></p>
<p>In case you&#8217;re not Photoshop-savvy, I have created a few templates that you can download and use.</p>
<ul>
<li><a href="http://www.kyleschaeffer.com/wordpress/wp-content/uploads/2009/09/TransparentCorners-10.psd">TransparentCorners-10.psd</a> &#8211; 10&#215;10 pixel corner image template</li>
<li><a href="http://www.kyleschaeffer.com/wordpress/wp-content/uploads/2009/09/TransparentCorners-15.psd">TransparentCorners-15.psd</a> &#8211; 15&#215;15 pixel corner image template</li>
<li><a href="http://www.kyleschaeffer.com/wordpress/wp-content/uploads/2009/09/TransparentCorners-20.psd">TransparentCorners-20.psd</a> &#8211; 20&#215;20 pixel corner image template</li>
</ul>
<h2>The Markup</h2>
<p>Now that we have this nice fancy reusable transparent corner image, it&#8217;s time to create the HTML that will be used to house our beautiful box and its contents. Here&#8217;s the basic setup:</p>
<pre>&lt;div class="box red"&gt;
	&lt;div class="corner TL"&gt;&lt;/div&gt;
	&lt;div class="corner TR"&gt;&lt;/div&gt;
	&lt;div class="corner BL"&gt;&lt;/div&gt;
	&lt;div class="corner BR"&gt;&lt;/div&gt;
	&lt;p&gt;This is your box content. Lorem ipsum dolor sit amet.&lt;/p&gt;
&lt;/div&gt;</pre>
<p>Pretty simple, right? We have an outer &#8220;box&#8221; <code>&lt;div/&gt;</code>, a <code>&lt;div/&gt;</code> for each corner, and then our content that will appear inside the box.</p>
<h2>The Style</h2>
<p>Our HTML doesn&#8217;t do much by itself. Most of the work to be done is going to be done in our CSS style sheet. In an attached style sheet, add the following CSS:</p>
<pre>.box {
	position: relative;
	padding: 1em;
}
.red {
	background: #cc0000;
	color: #fff;
}
.corner {
	position: absolute;
	width: 10px;
	height: 10px;
	background: url(/path/to/cornerImage.png) no-repeat;
}
.TL {
	top: 0;
	left: 0;
	background-position: 0 0;
}
.TR {
	top: 0;
	right: 0;
	background-position: 100% 0;
}
.BL {
	bottom: 0;
	left: 0;
	background-position: 0 100%;
}
.BR {
	bottom: 0;
	right: 0;
	background-position: 100% 100%;
}</pre>
<p>As you can see, we&#8217;re really trying to keep this simple. Basically, we have an outer &#8220;box&#8221; style, a &#8220;red&#8221; style that sets the box&#8217;s background color to red, and finally individual &#8220;corner&#8221; styles that will automatically position themselves at the edges of our content, regardless of the height/width of that content. Groovy.</p>
<h2>The Result</h2>
<p>I&#8217;ve created a simple &#8220;white&#8221; background corner image for use on this page. What you get when you put all of this together is a very flexible corner system that requires very little HTML and CSS to implement:</p>
<style type="text/css">.box { position: relative; padding: 1em; margin: 0 0 1em 0; } .red { background: #cc0000; color: #fff; } .corner { position: absolute; width: 20px; height: 20px; background: url(/wordpress/wp-content/uploads/2010/09/cornersWhite.png) no-repeat; } .TL { top: 0; left: 0; background-position: 0 0; } .TR { top: 0; right: 0; background-position: 100% 0; } .BL { bottom: 0; left: 0; background-position: 0 100%; } .BR { bottom: 0; right: 0; background-position: 100% 100%; }</style>
<div class="box red">
<div class="corner TL"></div>
<div class="corner TR"></div>
<div class="corner BL"></div>
<div class="corner BR"></div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque justo felis, molestie rutrum blandit vitae, pellentesque vitae risus. Nunc hendrerit eleifend lectus. Aenean interdum facilisis sem eget laoreet. Morbi in nisl nec neque auctor volutpat. Nam sodales felis id magna cursus ac pretium libero mollis.
</p></div>
<p>And the coolest part&#8230;</p>
<h2>It&#8217;s Reusable!</h2>
<p>The coolest part about using transparent images for our corners is that we can apply these corners to just about anything on our page that we want to. For instance, I could create some additional box styles (other than &#8220;red&#8221;) by adding a bit of CSS.</p>
<pre>.red {
	background: #cc0000;
	color: #fff;
}
.blue {
	background: #00cc00;
	color: #fff;
}
.green {
	background: #0000cc;
	color: #fff;
}
.gray {
	background: #dedede;
	color: #666;
}</pre>
<p>After changing our box&#8217;s class (<code>class="box blue"</code>, <code>class="box green"</code>, etc.), we would get:</p>
<style type="text/css">.blue { background: #00cc00; color: #fff; } .green { background: #0000cc; color: #fff; } .gray { background: #dedede; color: #666; } .oneThird { float: left; width: 31.3%; margin: 0 2% 0 0; } .oneThirdBottom { clear: both; }</style>
<div class="oneThird">
<div class="box red">
<div class="corner TL"></div>
<div class="corner TR"></div>
<div class="corner BL"></div>
<div class="corner BR"></div>
<p>Suspendisse potenti. Morbi eget turpis urna. Fusce tincidunt sem mollis lacus euismod rhoncus sagittis est placerat.</p>
<p>&nbsp;</p>
</div>
</div>
<div class="oneThird">
<div class="box blue">
<div class="corner TL"></div>
<div class="corner TR"></div>
<div class="corner BL"></div>
<div class="corner BR"></div>
<p>Suspendisse potenti. Morbi eget turpis urna. Fusce tincidunt sem mollis lacus euismod rhoncus sagittis est placerat.</p>
<p>&nbsp;</p>
</div>
</div>
<div class="oneThird">
<div class="box green">
<div class="corner TL"></div>
<div class="corner TR"></div>
<div class="corner BL"></div>
<div class="corner BR"></div>
<p>Suspendisse potenti. Morbi eget turpis urna. Fusce tincidunt sem mollis lacus euismod rhoncus sagittis est placerat.</p>
<p>&nbsp;</p>
</div>
</div>
<div class="box gray" style="clear: both;">
<div class="corner TL"></div>
<div class="corner TR"></div>
<div class="corner BL"></div>
<div class="corner BR"></div>
<p>Gray is the new &#8220;red&#8221;. Vestibulum iaculis varius laoreet. Ut et condimentum nunc. Suspendisse eleifend congue dolor, non consequat ante tristique sit amet.</p>
</div>
<p>That&#8217;s really cool, but this doesn&#8217;t even touch the limits of how you can apply this. In addition to solid color boxes, we could also apply this to photos and gradients (which would be much harder in a more traditional corner system). Our corners really don&#8217;t care what type of content they&#8217;re applied on, they only really care about the background color. Let&#8217;s try it out on some different page elements (accompanying HTML and CSS are included for each style):</p>
<h2>The Mini Profile</h2>
<h3>HTML:</h3>
<pre>&lt;div class="box photo"&gt;
	&lt;div class="corner TL"&gt;&lt;/div&gt;
	&lt;div class="corner TR"&gt;&lt;/div&gt;
	&lt;div class="corner BL"&gt;&lt;/div&gt;
	&lt;div class="corner BR"&gt;&lt;/div&gt;
	&lt;h3&gt;My Profile&lt;/h3&gt;
	&lt;img src="kyle.jpg" alt="Me" /&gt;
&lt;/div&gt;</pre>
<h3>CSS:</h3>
<pre class="brush:css">.photo {
	width: 200px;
	padding: 0;
}
.photo h3 {
	background: #000;
	color: #fff;
	padding: 10px 20px;
	margin: 0;
	font-size: 1em;
}</pre>
<style type="text/css">.myPhoto { width: 200px; padding: 0; } .myPhoto h3 { background: #000; color: #fff; padding: 10px 20px; margin: 0; font-size: 1em; }</style>
<div class="box myPhoto">
<div class="corner TL"></div>
<div class="corner TR"></div>
<div class="corner BL"></div>
<div class="corner BR"></div>
<h3>My Profile</h3>
<p><img style="padding: 0; border: 0; margin: 0;" src="http://kyleschaeffer.com/wordpress/wp-content/uploads/2008/10/kyle.jpg" alt="Me" /></div>
<h2>The Gradient</h2>
<h3>HTML:</h3>
<pre>&lt;div class="box blueGradient"&gt;
	&lt;div class="corner TL"&gt;&lt;/div&gt;
	&lt;div class="corner TR"&gt;&lt;/div&gt;
	&lt;div class="corner BL"&gt;&lt;/div&gt;
	&lt;div class="corner BR"&gt;&lt;/div&gt;
	&lt;p&gt;Notice the gradient background image!&lt;/p&gt;
&lt;/div&gt;</pre>
<h3>CSS:</h3>
<pre>.blueGradient {
	background: url(gradient-image.png) repeat-x;
	color: #fff;
}</pre>
<style type="text/css">.blueGradient { background: #a9e4f7; background: -moz-linear-gradient(top, #a9e4f7 0%, #0fb4e7 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#a9e4f7), color-stop(100%,#0fb4e7)); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a9e4f7', endColorstr='#0fb4e7',GradientType=0 ); background: -o-linear-gradient(top, #a9e4f7 0%,#0fb4e7 100%); }</style>
<div class="box blueGradient">
<div class="corner TL"></div>
<div class="corner TR"></div>
<div class="corner BL"></div>
<div class="corner BR"></div>
<p>Notice the gradient background image! Lorem ipsum dolor sit amet, consectetur adipiscing elit. In facilisis posuere purus, vitae sagittis enim sodales at. Proin in purus et metus vestibulum cursus. Vivamus volutpat dolor quis lectus cursus et lobortis felis iaculis. Aenean ut enim magna, sit amet convallis mi. In hac habitasse platea dictumst. In hac habitasse platea dictumst.</p>
</div>
<p>We&#8217;ve accomplished all of the styles you see above using a single image and some fancy CSS footwork. This really minimizes the impact of your corners on page download times, especially if you&#8217;re using a number of different styles on a single background color. No scripts, no confusing HTML, simple markup, and a single image. Happy styling.</p>
]]></content:encoded>
			<wfw:commentRss>http://kyleschaeffer.com/best-practices/reusable-transparent-css-rounded-corners/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>A Whole New Web?</title>
		<link>http://kyleschaeffer.com/best-practices/a-whole-new-web/</link>
		<comments>http://kyleschaeffer.com/best-practices/a-whole-new-web/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 17:16:32 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Corners]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://www.kyleschaeffer.com/?p=243</guid>
		<description><![CDATA[Should we abandon rounded corner techniques that require additional HTML markup in favor of emerging CSS techniques that are not yet supported on all browsers? Apparently, the answer is an overwhelming YES. I&#8217;m very fortunate for having attended An Event &#8230; <a href="http://kyleschaeffer.com/best-practices/a-whole-new-web/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Should we abandon rounded corner techniques that require additional HTML markup in favor of emerging CSS techniques that are not yet supported on all browsers? Apparently, the answer is an overwhelming YES.<span id="more-243"></span></p>
<p>I&#8217;m very fortunate for having attended <a href="http://www.aneventapart.com">An Event Apart</a> in Boston this week. I talked to thought leaders, design experts, tech gurus, and many more interesting and successful people during the event. I&#8217;m accustomed to being the only &#8220;UI guy&#8221; in the small organizations that I&#8217;ve worked for, so it was nice to meet other people who do what I do. One of the most interesting things that I took away from the event was the fact that design leaders are strongly pushing for web design to move in a new direction (well, I&#8217;m not sure if it&#8217;s fair to call it &#8220;new,&#8221; but the push is stronger than ever before).</p>
<p>What I mean when I say this is that many designers are asking you to stop using rounded corner techniques that require extraneous HTML (use the CSS property <code>border-radius</code> instead).  Stop using semi-transparent PNG images for background colors (use <code>rgba</code> instead).  Stop doing all those little extra things that you do in order to make sure your site is pixel-perfect on every single browser and operating system. Like I said, it&#8217;s certainly not a new subject to bring up, but I was surprised at the ferverous support behind it at the conference. I had briefly touched on this subject in my post about <a href="http://www.kyleschaeffer.com/best-practices/rounded-corners-in-mozilla-and-safari/">CSS rounded corners</a>, where I seem to have agreed with these experts on a number of levels. My opinion is that you should never choose to increase page load times for everyone just simply to ensure that IE users can see rounded corners.</p>
<p>I think <a href="http://www.simplebits.com/">Dan Cederholm</a> said it best when he referred to these little design touches (such as rounded corners) as &#8220;design rewards&#8221; for users who are using the most common OS/browser combinations. Don&#8217;t think them as design features, but rather as rewards for users who can utilize them. This makes your site faster, more flexible, and easier to develop. Dan is so passionate about this concept that he created a website to convey his feelings:</p>
<p><a href="http://dowebsitesneedtolookexactlythesameineverybrowser.com/">Do websites need to look exactly the same in every browser?</a></p>
<p>I&#8217;m not saying we should do away with rounded corner techniques entirely. In fact, I use my own <a href="http://www.kyleschaeffer.com/tutorials/karate-corners-easy-rounded-corners-xhtml-no-script/">Karate Corners</a> all the time, but I do it when it&#8217;s necessary and appropriate.  If I&#8217;m working on my own project (where I am the primary stakeholder), I will most certainly go the pure CSS route, but as designers, we know that our clients don&#8217;t always agree. The most prominent argument against this concept is that our clients don&#8217;t really understand the benefits of using pure CSS to create corners and other design &#8220;rewards.&#8221; The only thing the client can understand is that Mr. CIO uses IE6 on his Windows 2000 desktop and he wants to see the rounded corners that were shown to him in the design concept.</p>
<p>It&#8217;s a difficult thing to manage client expectations, and sometimes it&#8217;s necessary to bite the bullet and give the client exactly what they want, even if you disagree with them. The best thing we can do is to make the benefits of this technique clear to the client, and hope that they can let go of the aging concept that your website has to be identical on all possible combinations of platform and browser.</p>
<p>There&#8217;s certainly a discussion to be had, and I&#8217;d love to hear your thoughts on the subject. Let the debate begin&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://kyleschaeffer.com/best-practices/a-whole-new-web/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Rounded Corners in Mozilla and Safari</title>
		<link>http://kyleschaeffer.com/best-practices/rounded-corners-in-mozilla-and-safari/</link>
		<comments>http://kyleschaeffer.com/best-practices/rounded-corners-in-mozilla-and-safari/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 22:35:34 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Corners]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.kyleschaeffer.com/?p=156</guid>
		<description><![CDATA[The W3C&#8217;s CSS3 specification includes an oft-requested CSS attribute called border-radius. Using this attribute, you can create rounded-corner boxes that use no images, script, or other fancy DHTML tricks (pure CSS). This will make your site flexible, faster, and more &#8230; <a href="http://kyleschaeffer.com/best-practices/rounded-corners-in-mozilla-and-safari/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The W3C&#8217;s CSS3 specification includes an oft-requested CSS attribute called <code>border-radius</code>. Using this attribute, you can create rounded-corner boxes that use no images, script, or other fancy DHTML tricks (pure CSS). This will make your site flexible, faster, and more accessible. It&#8217;s not yet supported in Internet Explorer 7/8, but other modern browsers have already introduced support for this fantastic CSS feature.<span id="more-156"></span></p>
<p>Both Mozilla Firefox and Apple&#8217;s Safari browsers have made it incredibly easy to eliminate those sharp corners with a single CSS attribute. Here&#8217;s the code:</p>
<pre>.myRoundedBox {
	-moz-border-radius: 10px;
	-webkit-border-radius: 10px;
}</pre>
<p>You&#8217;ll notice that this CSS isn&#8217;t merely clipping the contents of the block element you&#8217;re applying it to. If your <code>&lt;div/&gt;</code> has a border associated with it, the border will adhere to the contours of your newly rounded corner. Throw in a slight background color or gradient, and you can create some really stunning effects. Here&#8217;s a quick look at something I was creating, just to play around with this great new feature:</p>
<p><img title="BORDER-RADIUS In Action" src="http://kyleschaeffer.com/wordpress/wp-content/uploads/2009/01/radius-example.png" alt="BORDER-RADIUS In Action" width="331" height="225" /></p>
<p>Using border-radius instead of corner images can eliminate a lot of HTML and unneeded CSS, which saves on bandwidth and improves the performance of your site as a whole. Of course, the big monster of a caveat here is that your design won&#8217;t be consistent across browsers. That certainly isn&#8217;t good, but on the other hand, rounded corners don&#8217;t have any effect on the functionality of your site, so it will work just the same on any browser.</p>
<p>For more information about this upcoming CSS3 attribute, <a href="http://www.w3.org/TR/css3-background/#border-radius">see the official W3C specification here</a>. In addition, Mozilla&#8217;s proprietary support for this feature is <a href="https://developer.mozilla.org/en/CSS/-moz-border-radius">documented here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kyleschaeffer.com/best-practices/rounded-corners-in-mozilla-and-safari/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Five Elegant Rounded Corner Boxes</title>
		<link>http://kyleschaeffer.com/web-controls/five-elegant-rounded-corner-boxes/</link>
		<comments>http://kyleschaeffer.com/web-controls/five-elegant-rounded-corner-boxes/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 14:57:10 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Web Controls]]></category>
		<category><![CDATA[Corners]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.kyleschaeffer.com/?p=101</guid>
		<description><![CDATA[I wanted to really take the concept of my &#8220;Karate Corners&#8221; design to new levels, so I created this simple demo to show you how visual elegance can work in tandem with technical simplicity. Seeing is believing, so without further &#8230; <a href="http://kyleschaeffer.com/web-controls/five-elegant-rounded-corner-boxes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I wanted to really take the concept of my &#8220;<a href="http://www.kyleschaeffer.com/?p=31">Karate Corners</a>&#8221; design to new levels, so I created this simple demo to show you how visual elegance can work in tandem with technical simplicity.<span id="more-101"></span></p>
<p>Seeing is believing, so without further adieu&#8230;</p>
<p><a href="http://www.kyleschaeffer.com/karatecorners/"><img class="alignnone size-full wp-image-102" title="Karate Corners Demo" src="http://kyleschaeffer.com/wordpress/wp-content/uploads/2008/10/karate-demo.jpg" alt="" border="0" width="319" height="173" /></a></p>
<p><strong><a href="http://www.kyleschaeffer.com/karatecorners/">View the Karate Corners Demo by clicking here.</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://kyleschaeffer.com/web-controls/five-elegant-rounded-corner-boxes/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Karate Corners: XHTML/CSS Rounded Corners</title>
		<link>http://kyleschaeffer.com/tutorials/karate-corners-easy-rounded-corners-xhtml-no-script/</link>
		<comments>http://kyleschaeffer.com/tutorials/karate-corners-easy-rounded-corners-xhtml-no-script/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 12:58:10 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Controls]]></category>
		<category><![CDATA[Corners]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.kyleschaeffer.com/?p=31</guid>
		<description><![CDATA[I&#8217;ve seen a lot of different ways to create round corners and boxes in web sites, and quite frankly I haven&#8217;t exactly fallen in love with any of them. A lot of the methods that I&#8217;ve seen use either (1) &#8230; <a href="http://kyleschaeffer.com/tutorials/karate-corners-easy-rounded-corners-xhtml-no-script/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen a lot of different ways to create round corners and boxes in web sites, and quite frankly I haven&#8217;t exactly fallen in love with any of them.  A lot of the methods that I&#8217;ve seen use either (1) a table structure which I try to avoid at all costs, (2) too many nested <code>&lt;div&gt;</code> tags, (3) complex CSS, or (4) too many different images that have to be loaded all at once.<span id="more-31"></span></p>
<p><strong>Update:</strong> <a href="http://www.kyleschaeffer.com/web-controls/five-elegant-rounded-corner-boxes/">Read my subsequent post for a more advanced example of this technique!</a><br />
<strong>Update:</strong> <a href="http://www.kyleschaeffer.com/best-practices/reusable-transparent-css-rounded-corners/">Read a even <em>more</em> advanced version of this technique in an even <em>newer</em> tutorial!</a><br />
<strong>Update:</strong> <a href="http://www.kyleschaeffer.com/tutorials/ie-corner-inserts-via-jquery/">Find out how to automatically generate the HTML and CSS for this technique using jQuery.</a></p>
<p>I took the best of the best and came up with a very simple way to create totally scalable boxes with round corners.  I&#8217;ve tested this on Internet Explorer 6, IE 7, Mozilla FireFox 2, Firefox 3, Opera 9, and Safari 3.</p>
<h2>The Code</h2>
<p>The HTML code is relatively simple.  You have an outer <code>&lt;div&gt;</code> tag with four &#8220;corner&#8221; <code>&lt;div&gt;</code>s inside of it.  Each of these corner <code>&lt;div&gt;</code>s are positioned with CSS so that they always appear at each corner of the outer <code>&lt;div&gt;</code> box.</p>
<h3>HTML:</h3>
<pre>&lt;div class="cornerBox"&gt;
    &lt;div class="corner TL"&gt;&lt;/div&gt;
    &lt;div class="corner TR"&gt;&lt;/div&gt;
    &lt;div class="corner BL"&gt;&lt;/div&gt;
    &lt;div class="corner BR"&gt;&lt;/div&gt;
    &lt;div class="cornerBoxInner"&gt;
        &lt;p&gt;Lorem ipsum dolor sit amet.&lt;/p&gt;
    &lt;/div&gt;
&lt;/div&gt;</pre>
<h3>CSS:</h3>
<pre>.cornerBox {
	position: relative;
	background: #cfcfcf;
	width: 100%;
}
.corner {
	position: absolute;
	width: 10px;
	height: 10px;
	background: url('corners.gif') no-repeat;
	font-size: 0%;
}
.cornerBoxInner {
	padding: 10px;
}
.TL {
	top: 0;
	left: 0;
	background-position: 0 0;
}
.TR {
	top: 0;
	right: 0;
	background-position: -10px 0;
}
.BL {
	bottom: 0;
	left: 0;
	background-position: 0 -10px;
}
.BR {
	bottom: 0;
	right: 0;
	background-position: -10px -10px;
}</pre>
<h2>The Image</h2>
<p><img class="size-medium wp-image-32" title="The 20x20 corner image used in this demo." src="http://kyleschaeffer.com/wordpress/wp-content/uploads/2008/10/corners.gif" alt="The 20x20 corner image used in this demo." width="20" height="20" /></p>
<p>Only one image is used for this box (shown above).  In my example, I created a 20&#215;20 circle, which is comprised of four 10&#215;10 corners.  By shifting the background image around, you can eliminate the need to download four separate GIF files on each of your boxes.</p>
<h2>The Result</h2>
<p><a href="http://kyleschaeffer.com/wordpress/wp-content/uploads/2008/10/karatecornersdemo.htm" target="_blank"><img class="size-full wp-image-34" title="Click on this image to see the demo, where you can resize your browser window to see how the box scales as the height and width changes." src="http://kyleschaeffer.com/wordpress/wp-content/uploads/2008/10/cornersbox.gif" border="0" alt="Click on this image to see the demo, where you can resize your browser window to see how the box scales as the height and width changes." width="472" height="122" /></a></p>
<p>Karate Corners!  Click on the image above to see the HTML demo.  Happy styling!</p>
]]></content:encoded>
			<wfw:commentRss>http://kyleschaeffer.com/tutorials/karate-corners-easy-rounded-corners-xhtml-no-script/feed/</wfw:commentRss>
		<slash:comments>75</slash:comments>
		</item>
	</channel>
</rss>

