<?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>SVZ Solutions Blog</title>
	<atom:link href="http://blog.svzsolutions.nl/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.svzsolutions.nl</link>
	<description>Weblog of a small dutch company</description>
	<lastBuildDate>Fri, 12 Aug 2011 15:59:37 +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>Applying rounded corners to a single element using CSS 2.1 creating true dynamic buttons and or tabs</title>
		<link>http://blog.svzsolutions.nl/2009/07/26/applying-rounded-corners-to-a-single-element-using-css-2-1-creating-true-dynamic-buttons-and-or-tabs/</link>
		<comments>http://blog.svzsolutions.nl/2009/07/26/applying-rounded-corners-to-a-single-element-using-css-2-1-creating-true-dynamic-buttons-and-or-tabs/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 20:41:58 +0000</pubDate>
		<dc:creator>Stefan van Zanden</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS 2.1]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.svzsolutions.nl/?p=60</guid>
		<description><![CDATA[One of the things I have been struggling with in my carreer is finding a good satisfieing way of making usable rounded cornered buttons / tabs, now that Internet Explorer 8 has been released we webdesigners can finally make some &#8230; <a href="http://blog.svzsolutions.nl/2009/07/26/applying-rounded-corners-to-a-single-element-using-css-2-1-creating-true-dynamic-buttons-and-or-tabs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the things I have been struggling with in my carreer is finding a good satisfieing way of making usable rounded cornered buttons / tabs, now that Internet Explorer 8 has been released we webdesigners can finally make some more use of the newly become available techniques like CSS 2.1, in this post ill describe a new technique I have been figuring / testing out these past weeks for this purpose.</p>
<p><span id="more-60"></span></p>
<p>First things first, so far I have been using the technique described by Douglas Bowman in his post <a class="external-link" title="Sliding Doors of CSS" href="http://www.alistapart.com/articles/slidingdoors/">Sliding Doors of CSS</a> in my projects, this technique however isn&#8217;t perfect in both a technical and usability point of view but it was the best available so far in my opinion, some of the issues I have with it are:</p>
<ol>
<li>The left part of the tab is not clickable without the use of javascript (so user hovers and tries to click but nothing happens);</li>
<li>You need 1 image that is very long applied to the HTML element <strong>a</strong> to &#8220;fake&#8221; a dynamic effect;</li>
<li>In order to use this technique for buttons you need to add an extra unnecessary HTML element around it like a <strong>div</strong> or a <strong>span</strong>.</li>
</ol>
<p>To see my point you can check out one of his samples <a class="external-link" title="Slidingdoors example" href="http://www.alistapart.com/d/slidingdoors/v1/v1.html">here</a></p>
<p>Now I would like to turn this around and introduce a new technique which follows these target rules:</p>
<ol>
<li>The styling must be applieable to 1 HTML element so we don&#8217;t need to &#8220;clutter&#8221; our HTML pages with unnecessary HTML elements saving some data transmission (altough small);</li>
<li>The button or tab must be fully clickable over the parts the user can see;</li>
<li>The button or tab must follow the principals of <a class="external-link" title="Unobrusive Javascript" href="http://en.wikipedia.org/wiki/Unobtrusive_JavaScript">Unobtrusive Javascript</a> (so it must look and be hoverable like a button even when javascript is disabled);</li>
<li>It must work flawless in all the latest of commonly used W3C compliant browsers (Firefox / IE8 / Opera / Safari / Chrome);</li>
<li>It must be true dynamic with the use of a maximum of 3 images (forming the left and right corners and the middle part) for each state (normal / hover / active etc..);</li>
<li>The rounded corners must be able to have a transparent background to overflow nicely into the design behind it (so you don&#8217;t have to make alot of buttons with different backgrounds);</li>
</ol>
<h3>Current issues with this technique</h3>
<p>It will not work in IE6 or IE7 and some other older browsers, it will however still be usable for your users, but they will look a bit worse. I didn&#8217;t had the time to figure out some &#8220;nice&#8221; &#8220;hacks&#8221; which you can include by using IE6 / IE7 only stylesheets. Due to some other issues it will also not work in for example FF2 and Opera 8.01, it does work however in all major new browsers.</p>
<h3>Outcome of current tests with this technique</h3>
<p>So far I tested this technique on the following system / browsers combinations:</p>
<p>The following list is tested and is working 100% and will look like the image below.</p>
<p><img class="alignnone size-medium wp-image-105" title="Mac OS X - Firefox 3.5 - Result CSS 2.1 Cornered buttons / tabs" src="http://blog.svzsolutions.nl/wp-content/uploads/2009/07/macosx-firefox-3.5-300x70.jpg" alt="Mac OS X - Firefox 3.5 - Result CSS 2.1 Cornered buttons / tabs" width="300" height="70" /></p>
<p><strong>Mac OS X:</strong></p>
<ul>
<li>Firefox 3.5</li>
<li>Firefox 3.0.11</li>
<li>Safari 4</li>
</ul>
<p><strong>Windows:</strong></p>
<ul>
<li>Internet Explorer 8</li>
<li>Chrome 2.0</li>
<li>Opera 9.64</li>
</ul>
<p><strong>Linux:</strong></p>
<ul>
<li>Firefox 3.0.11</li>
</ul>
<p>Tested but not working 100%, see resulting images for the current issues.</p>
<p><strong>Windows:</strong></p>
<ul class="image-list">
<li><img class="size-medium wp-image-102 alignright" title="Windows XP - Firefox 2 - Result CSS 2.1 Cornered buttons / tabs" src="http://blog.svzsolutions.nl/wp-content/uploads/2009/07/winxp-firefox-2-300x65.jpg" alt="Windows XP - Firefox 2 - Result CSS 2.1 Cornered buttons / tabs" width="300" height="65" />Firefox 2.0</li>
<li><img class="size-medium wp-image-104 alignright" title="Windows XP - Opera 8.01 - Result CSS 2.1 Cornered buttons / tabs" src="http://blog.svzsolutions.nl/wp-content/uploads/2009/07/winxp-opera-8.01-300x64.jpg" alt="Windows XP - Opera 8.01 - Result CSS 2.1 Cornered buttons / tabs" width="300" height="64" />Opera 8.01</li>
<li><img class="size-medium wp-image-103 alignright" title="Windows XP - Internet Explorer 7 - Result CSS 2.1 Cornered buttons / tabs" src="http://blog.svzsolutions.nl/wp-content/uploads/2009/07/winxp-ie-7-300x70.jpg" alt="Windows XP - Internet Explorer 7 - Result CSS 2.1 Cornered buttons / tabs" width="300" height="70" />IE 7 / IE 6</li>
</ul>
<h2>The technique</h2>
<h3><strong>What CSS 2.1 techniques will we use exactly?</strong></h3>
<p>We will use the following new techniques available to us:</p>
<ul>
<li>The pseudo elements :before and :after;</li>
<li>Generated content using the content property;</li>
</ul>
<h3>Creating a button</h3>
<p>In this article I will only describe the Button from the final example to explain the technique, the tab isn&#8217;t that different though and is visible in the final example.</p>
<h4>Step 1: The HTML structure</h4>
<p>Put down the following HTML structure in your HTML document:<br />
<pre><pre>&amp;lt;div class=&quot;component-button-container&quot;&amp;gt;
&nbsp;&nbsp;&amp;lt;a class=&quot;component-button&quot; href=&quot;#&quot;&amp;gt;Button 1&amp;lt;/a&amp;gt;
&nbsp;&nbsp;&amp;lt;a class=&quot;component-button&quot; href=&quot;#&quot;&amp;gt;Button 2 slightly longer.&amp;lt;/a&amp;gt;
&amp;lt;/div&amp;gt;</pre></pre></p>
<h4>Step 2: The images</h4>
<p>The next thing we need is some images, the following is a list of images I quickly created using <a class="external-link" title="GIMP" href="http://www.gimp.org/">GIMP</a> with some article on the internet wich I can&#8217;t remember anymore <img src='http://blog.svzsolutions.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . I needed a total of 6 images for each component wich formed the left middle and right of 2 states.</p>
<p>Button &#8211; Normal state:</p>
<ul>
<li><a class="external-link" title="Button normal left corner image" href="http://svzsolutions.nl/samples/img/component-button-normal-left.png">Left corner</a></li>
<li><a class="external-link" title="Button normal middle corner image" href="http://svzsolutions.nl/samples/img/component-button-normal-middle.png">Middle</a></li>
<li><a class="external-link" title="Button normal right corner image" href="http://svzsolutions.nl/samples/img/component-button-normal-right.png">Right corner</a></li>
</ul>
<p>Button &#8211; Hover state:</p>
<ul>
<li><a class="external-link" title="Button hover left corner image" href="http://svzsolutions.nl/samples/img/component-button-hover-left.png">Left corner</a></li>
<li><a class="external-link" title="Button hover middle corner image" href="http://svzsolutions.nl/samples/img/component-button-hover-middle.png">Middle</a></li>
<li><a class="external-link" title="Button hover right corner image" href="http://svzsolutions.nl/samples/img/component-button-hover-right.png">Right corner</a></li>
</ul>
<p>I am not a designer so they are suppose to look crap and are merely used for the example <img src='http://blog.svzsolutions.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Download these button images and upload them to some dir on your webserver.</p>
<h4>Step 3: Doing some CSS</h4>
<p>Now it&#8217;s time to do some CSS magic, in the example which I provide at the end I have put the most important CSS for clearance into embedded CSS, which means it has been put between the following tags straight in the HTML document served:<br />
<pre id="line11">&amp;lt;&lt;span class=&quot;start-tag&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;attribute-name&quot;&gt; type&lt;/span&gt;=&lt;span class=&quot;attribute-value&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&amp;gt;&amp;lt;/style&amp;gt;</pre><br />
So now that we have the HTML in place and uploaded the images we can start by creating the left and right corner of each element that needs it, we gonna start by providing the button some generated content on which we can project the left and right rounded cornered image, the content will be &#8216;<strong>\a0&#8242;</strong>, which is a hexcode for a non-breaking space, I do this because I want the image to always be shown and this won&#8217;t happen in browsers like IE8 and Opera when you only use a non-breaking space like &#8216; &#8216;, when that is put in we will make the generated content show as an <strong>inline-block</strong> so we will be able to give it a height / width. Give it a width of 7px (the exact same width of the left and right image itself), you don&#8217;t need to set the height of the generated content because it will inherit it&#8217;s height of the main element:<br />
<pre><pre>.component-button:before, .component-button:after {
display: inline-block;
width: 7px;
content: &#039;\a0&#039;; /* Hexcode for non-breaking space */
}</pre></pre><br />
Now we don&#8217;t see much yet, so we need to give both ends a nice background in it&#8217;s normal and hover states and add some spacing between the cornered image and the text, also it is important to provide a minus margin-left / margin-right of exactly the same amount as the left and or right cornered image width (the 7px in the example above) so the image will not render over the middle image, we will do that like this:<br />
<pre><pre>.component-button:before {
background: transparent url(&#039;samples/img/component-button-normal-left.png&#039;) no-repeat top left;
margin-left: -7px;
padding-left: 10px;
}

.component-button:after {
background: transparent url(&#039;samples/img/component-button-normal-right.png&#039;) no-repeat top right;
margin-right: -7px;
padding-right: 10px;
}

.component-button:hover:before {
background-image: url(&#039;samples/img/component-button-hover-left.png&#039;);
}

.component-button:hover:after {
background-image: url(&#039;samples/img/component-button-hover-right.png&#039;);
}</pre></pre><br />
Now that that is done, we need to style the main HTML element, provide it with the following CSS:<br />
<pre><pre>
&lt;pre id=&quot;line11&quot;&gt;.component-button {
display: block;
float: left;
background: transparent url(&#039;samples/img/component-button-normal-middle.png&#039;) repeat-x top left;
height: 20px;
line-height: 20px;
margin: 0 7px;
}
&lt;pre id=&quot;line11&quot;&gt;.component-button:hover {
background-image: url(&#039;samples/img/component-button-hover-middle.png&#039;);
}</pre></pre>
</pre>
</pre>
<p>The "<strong>display: block</strong>" ensures that we can influence the height of the HTML element and the float will make it display nicely next to another button. The "margin: 0 7px;" ensure that other buttons are not rendered above this HTML element.</p>
<p>The final example of this technique can be found <a class="external-link" title="Sample page of new rounded cornered tab buttons technique" href="http://svzsolutions.nl/sample-page-rounded-cornered-tab-buttons">here</a> it also contains some added styling to make it look somewhat better and it has styling / example for the tabs asswel.</p>
<h3>Your comments</h3>
<p>If you found some way to fix the minor issues in the FF2 / Opera 8.01 browsers or have successfully made it work in IE6 and / or IE7, feel free to post your comment and share it with me and the rest <img src='http://blog.svzsolutions.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>Update 2011-08-12:</strong><br />
Since writing this article the web has moved forward fast, nowadays I would not bother to create rounded effects (altough archievable using some javascript) but create it using CSS3, for a good resource check out <a href="http://www.zurb.com/article/266/super-awesome-buttons-with-css3-and-rgba" title="Super Awesome Buttons with CSS3 and RGBA by Mark">Super Awesome Buttons with CSS3 and RGBA by Mark</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.svzsolutions.nl/2009/07/26/applying-rounded-corners-to-a-single-element-using-css-2-1-creating-true-dynamic-buttons-and-or-tabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A new milestone for webdevelopers, Internet Explorer 8 released!</title>
		<link>http://blog.svzsolutions.nl/2009/03/19/a-new-milestone-for-webdevelopers-internet-explorer-8-released/</link>
		<comments>http://blog.svzsolutions.nl/2009/03/19/a-new-milestone-for-webdevelopers-internet-explorer-8-released/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 22:00:06 +0000</pubDate>
		<dc:creator>Stefan van Zanden</dc:creator>
				<category><![CDATA[Browser compatibility]]></category>
		<category><![CDATA[CSS 2.1]]></category>
		<category><![CDATA[Microsoft Internet Explorer]]></category>

		<guid isPermaLink="false">http://blog.svzsolutions.nl/?p=18</guid>
		<description><![CDATA[As of today people can download the latest version of Internet Explorer 8. This in my opinion is the a new milestone for webdevelopers with the long awaited full support of the W3C CSS 2.1 specification allowing us webdevelopers to &#8230; <a href="http://blog.svzsolutions.nl/2009/03/19/a-new-milestone-for-webdevelopers-internet-explorer-8-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As of today people can download the latest version of <a class="external-link" title="Microsoft Internet Explorer 8" href="http://microsoft.com/ie8">Internet Explorer 8</a>.</p>
<p>This in my opinion is the a new milestone for webdevelopers with the long awaited full support of the <a class="external-link" title="W3C CSS 2.1 specification" href="http://www.w3.org/TR/CSS21/">W3C CSS 2.1 specification</a> allowing us webdevelopers to create good semantic / clean styled webpages.</p>
<p><span id="more-18"></span>Ofcourse we can&#8217;t drop support for IE6 / IE7 just yet (or can we?), atleast we can start by following <a class="external-link" title="To hell with Bad Browsers" href="http://quirksmode.org/blog/archives/2009/02/to_hell_with_ba.html#more">others</a> in the industry and warn our visitors about there use of an old / insecure / inferieur browser and encourage them to upgrade, so in the end we will be able to spend the time otherwise lost in fixing quirks on focussing more on the quality of our websites.</p>
<p>Ill be upgrading my websites with a nice message asswel and post the method I used.</p>
<p>Also don&#8217;t be shy to post / &#8220;spam&#8221; any bugs to the Microsoft developers at their <a class="external-link" title="Microsoft Internet Explorer Blog" href="http://blogs.msdn.com/ie/archive/2009/03/19/internet-explorer-8-final-available-now.aspx#comments">blog</a>.</p>
<p>Soon the world will be a better place <img src='http://blog.svzsolutions.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.svzsolutions.nl/2009/03/19/a-new-milestone-for-webdevelopers-internet-explorer-8-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>First post!</title>
		<link>http://blog.svzsolutions.nl/2009/03/13/7/</link>
		<comments>http://blog.svzsolutions.nl/2009/03/13/7/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 14:25:18 +0000</pubDate>
		<dc:creator>Stefan van Zanden</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.svzsolutions.nl/?p=7</guid>
		<description><![CDATA[This is the first post on the just fresh installed WordPress blog for my own company (SVZ Solutions), I will be using this blog to post and share my findings about webdevelopment in general, mainly focussing on front-end stuff like &#8230; <a href="http://blog.svzsolutions.nl/2009/03/13/7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is the first post on the just fresh installed WordPress blog for my own company (SVZ Solutions), I will be using this blog to post and share my findings about webdevelopment in general, mainly focussing on front-end stuff like XHTML / CSS / (Unobtrusive) Javascript and also some occasionally rants about our beloved IE 6 / 7 friends.</p>
<p>Well that is ofcourse if I can find the time / interesting stuff to post <img src='http://blog.svzsolutions.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.svzsolutions.nl/2009/03/13/7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

