<?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>Blue Arena &#187; cross</title>
	<atom:link href="http://www.bluearena.com/tag/cross/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bluearena.com</link>
	<description>Web Development &#38; Digital Marketing</description>
	<lastBuildDate>Wed, 16 Nov 2011 20:37:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Rounded Corners and Fluid Boxes</title>
		<link>http://www.bluearena.com/2009/05/rounded-corners-and-fluid-boxes/</link>
		<comments>http://www.bluearena.com/2009/05/rounded-corners-and-fluid-boxes/#comments</comments>
		<pubDate>Fri, 22 May 2009 23:09:17 +0000</pubDate>
		<dc:creator>Maloric</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[corner]]></category>
		<category><![CDATA[corners]]></category>
		<category><![CDATA[cross]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[expand]]></category>
		<category><![CDATA[explorer]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[fluid]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[round]]></category>
		<category><![CDATA[rounded]]></category>

		<guid isPermaLink="false">http://wordpress.bluearena.com/?p=41</guid>
		<description><![CDATA[Rounded corners have long been a hot topic for web developers, with several methods out there, each with their benefits and disadvantages.  Although rounded corners seem to have fallen out of favour recently in favour of simple, clean designs, they still remain a powerful tool in any designer&#8217;s arsenal, which means knowing how to create [...]]]></description>
			<content:encoded><![CDATA[<p>Rounded corners have long been a hot topic for web developers, with several methods out there, each with their benefits and disadvantages.  Although rounded corners seem to have fallen out of favour recently in favour of simple, clean designs, they still remain a powerful tool in any designer&#8217;s arsenal, which means knowing how to create them is essential.  This tutorial will show you how to create tableless rounded corners than scale with fluid width and height, and can be expanded on to incorporate drop shadows or custom borders.<span id="more-41"></span></p>
<h2>What you need</h2>
<p>This tutorial assumes that you have a decent working knowledge of CSS and a little javascript (necessary if you want full IE6 support).  You&#8217;ll also need some sort of graphics editing software such as Adobe Photoshop or <a title="Go to the GIMP website" href="http://www.gimp.org/" target="_blank">the GIMP</a>.  I&#8217;ll be using Photoshop.</p>
<h2>Step 1: Design Your Box</h2>
<p><img class="alignleft size-medium wp-image-42" title="testbox" src="http://www.bluearena.com/wp-content/uploads/2009/05/testbox.gif" alt="testbox" width="197" height="126" />You&#8217;ll need to start off by creating an image of how your box will look when it&#8217;s finished.  For now I&#8217;m going to create a simple grey box with dark grey corners, something like the image you see here.  To create something similar simply draw a rectangle with rounded corners and add a 1px stroke.</p>
<p>It&#8217;s important that your box goes right to the edge of the image, so trim off any unneccessary white space.  You can save this as box1.gif.</p>
<h2>Step 2: The corners include</h2>
<p>The concept of this solution is to include four divs &#8211; one for each corner &#8211; that will be positioned absolutely within our both and styled appropriately.  Since this is the sort of technique that gets reused many times in the site, I prefer to create an include that contains all four corners.  Create a new file called &#8216;corners.html&#8217; and place the following markup inside:</p>
<pre>&lt;div class="tl corner"&gt;&lt;/div&gt;
&lt;div class="tr corner"&gt;&lt;/div&gt;
&lt;div class="bl corner"&gt;&lt;/div&gt;
&lt;div class="br corner"&gt;&lt;/div&gt;</pre>
<p>You&#8217;ll have noticed that each div has two classes.  The first just tells us which corner it is (top left, top right, bottom left and bottom right respectively).  The second lets us easily apply styles that all four corners will use.</p>
<h2>Step 3: The Box</h2>
<p>Let&#8217;s create the box and the markup we&#8217;ll need now, and then we&#8217;ll style it up once we&#8217;re done.  Where you want your box to appear, type the following code:</p>
<pre>&lt;div class="box1 corners"&gt;
    &lt;!--#include virtual='/path/to/corners.html'--&gt;
    &lt;div class="boxContent"&gt;
        &lt;p&gt;This is where your content will go&lt;/p&gt;
    &lt;/div&gt;
&lt;/div&gt;</pre>
<p>I&#8217;d better explain some of this.  The outer div is the box itself.  This will be styled to match your design and hads the extra class &#8220;corners&#8221; there to allow you to apply classes to all of your boxes, as well as making some of the javascript easier later.</p>
<p>Next is the corners include, which includes the four divs you created a moment ago.  Much nicer than including those manually every time, huh?</p>
<p>Last is a div called &#8220;boxContent&#8221;.  This is the div you&#8217;ll apply all of your padding to (allowing you to declare width:100% on the box itself without breaking anything).  It&#8217;s also useful to put overflow:hidden on the inner div to prevent the Firefox Float Bug if you float the contents of the box &#8211; this wouldn&#8217;t work on the outer box as the corners will need to be placed outside the box in order to work.  If all isn&#8217;t clear, don&#8217;t worry, just read on.</p>
<h2>Step 4: The CSS</h2>
<p>Ok, now for the fun part.  We&#8217;re going to start by styling up the basic box without rounded corners.  Basically what we need is a background colour, border and some padding.  Copy the following into your stylesheet:</p>
<pre>/* This allows us to position the corners relative to the box instead of the page */
div.corners { position:relative; }

/* This will make sure your corners never display over your content */
div.boxContent { position:relative; z-index:3; }

/* Styles specific to box1 */
div.box1 { color:#000; background:#E0E0E0; border:1px solid #666; }
div.box1 div.boxContent { padding:12px; overflow:hidden; }</pre>
<p>That&#8217;s it for the box.  Now for the corners.  They&#8217;re all going to be the same size and have many similar properties.  I like to create a seperate stylesheet for box/corner styles, but you&#8217;re welcome to put them where you like.</p>
<pre>div.corner { width:12px; height:12px; position:absolute; z-index:2;}
div.tl { top:-1px; left:-1px; background-position:top left; }
div.tr { top:-1px; right:-1px; background-position:top right; }
div.bl { bottom:-1px; left:-1px; background-position:bottom left; }
div.br { bottom:-1px; right:-1px; background-position:bottom right; }</pre>
<p>This has given us some universal corner styles.  Now we need to point our box 1 corners at the correct background image.  Add this line to your stylesheet and you&#8217;re good to go:</p>
<pre>div.box1 div.corner { background-image:url(/path/to/box1.gif); }</pre>
<p>Go on &#8211; check out your box now.  If you&#8217;re thinking that it can&#8217;t be that easy, think again.  You only had to cut out one image, not 4, and the box resizes perfectly in every modern browser.</p>
<h2>The Exception to the Rule</h2>
<p>Unfortunately if you&#8217;re using IE6 you&#8217;ll notice a rather frustrating bug.  If your box width or height is an odd number the bottom and right coordinates of your boxes will be 1px too short, meaning the border will show through.  There are two solutions.  The first uses javascript, and is my preferred method, to be covered in another post.  The second method involves only css:</p>
<p>The easiest way to fix the right coordinate is to fix the width of each box to an even number.  This isn&#8217;t too bad for fixed width sites, though could pose a problem for fluid layouts.  Unfortunately the bottom coordinate can&#8217;t be so easily fixed due to the fact that boxes should expand downward depending on the content.  So we need a more complex solution.</p>
<p>First, add the following line to corners.html:</p>
<pre>&lt;div class="btm corner"&gt;&lt;/div&gt;</pre>
<p>This div will be styled to mimic the bottom edge of the box.  We&#8217;ll need a background image for it, which will be a 2px or greater slice of the bottom of the box.  This will need to be repeated horizontally, so make sure there&#8217;s nothing else in the image.</p>
<p>Now you&#8217;ll need to change the &#8220;bottom&#8221; coordinate of your &#8220;bl&#8221; and &#8220;br&#8221; corners to -2px instead of -1px.  This means the corners will display 1px further down than they should.  This is where the &#8220;btm&#8221; div comes into play.  Add the following to your stylesheet:</p>
<pre>div.btm {
    height:12px;
    width:100%;
    bottom:-2px;
    left:-1px;
    background:url(/path/to/box1-btm.gif) bottom repeat-x;
    z-index:1;
}</pre>
<p>Now the bottom div will display 1px out the same as the corners, but because the three divs cover the bottom edge of the box, you can&#8217;t see the discrepancy, providing a CSS only solution to the problem.  Note that the bottom div needs to be placed below the two corners, hence a z-index of 1.</p>
<h3>Next time: A Javascript Solution</h3>
<p>Next time we&#8217;ll look at fixing the IE6 problem using JQuery to reposition the corners depending on the width of their parent.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluearena.com/2009/05/rounded-corners-and-fluid-boxes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6 &#8211; When Enough Is Enough</title>
		<link>http://www.bluearena.com/2009/05/ie6-when-enough-is-enough/</link>
		<comments>http://www.bluearena.com/2009/05/ie6-when-enough-is-enough/#comments</comments>
		<pubDate>Tue, 19 May 2009 20:41:25 +0000</pubDate>
		<dc:creator>Maloric</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[compatibility]]></category>
		<category><![CDATA[compliant]]></category>
		<category><![CDATA[cross]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[develop]]></category>
		<category><![CDATA[explorer]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[standard]]></category>
		<category><![CDATA[w3c]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://wordpress.bluearena.com/?p=13</guid>
		<description><![CDATA[On August 1st, 2001, Microsoft revealed their newest browser, IE6, which replaced IE5.5.  IE6 came bundled with Windows XP, and as such became the most used browser of its time.  In fact, when Internet Explorer 7 was release in October 2006, IE6 continued to hold a greater market share than its successor for almost a [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-38" title="broken-ie6" src="http://www.bluearena.com/wp-content/uploads/2009/05/broken-ie6.jpg" alt="broken-ie6" width="153" height="101" />On August 1st, 2001, Microsoft revealed their newest browser, IE6, which replaced IE5.5.  IE6 came bundled with Windows XP, and as such became the most used browser of its time.  In fact, when Internet Explorer 7 was release in October 2006, IE6 continued to hold a greater market share than its successor for almost a year.  Eventually users began to move onto IE7, and many even shifted to Mozilla Firefox, the open source browser.  At the time of writing, IE6 still holds an impressive ~17% of the market, which I put down to one factor: Windows XP.<span id="more-13"></span></p>
<p>Since IE6 comes bundled with Windows XP, which currently holds a 62% market share, it&#8217;s no surprise that IE6 is so widely used despite its age.  Although it is very simple for users to upgrade to Internet Explorer 7, many choose not to simply because they prefer to use what they know, or because IE6 works just fine for them.  And in fairness, many users wouldn&#8217;t notice a difference in how websites look between one browser and the next.</p>
<p>But that&#8217;s because we web developers have to spend sometimes hours at a time testing and tweaking websites until they work flawlessly in a browser that was <strong>replaced </strong>over two years ago.  I don&#8217;t blame Microsoft, since Internet Explorer 7 was a huge leap forward in terms of W3C compliance.  And Internet Explorer 8, which replaced its predecessor in March this year, is even better still.  I don&#8217;t even blame the people using Internet Explorer 6, as a lot of them probably don&#8217;t even realise there is a problem.  I blame the web developers who continue to support it.  Now I know a lot of you will tell me it&#8217;s not financially viable to drop support for such a widely used browser, but I&#8217;m not talking about abandoning it altogether.  I just mean if you have to choose between supporting IE6 and using more modern techniques, then you should opt for the latter.</p>
<h4>It starts to get a bit technical from here on in&#8230;</h4>
<p>A simple example is this: Internet Explorer 6 can&#8217;t recognise the &#8220;:hover&#8221; meta class on any element except for a hyperlink.  It can&#8217;t recognise &#8220;:first-child&#8221; or something as simple as &#8220;ul &gt; li&#8221; (denoting a direct descendant).  If you need to simulate these styles for the sake of functionality, then it is acceptable to use javascript.  But if you need to simlate a style for a purely visual reason, then forget it.  Here&#8217;s an example:</p>
<pre>&lt;ul class="horizontalList"&gt;
    &lt;li&gt;Test list item 1&lt;/li&gt;
    &lt;li&gt;Test list item 2&lt;/li&gt;
    &lt;li&gt;Test list item 3&lt;/li&gt;
    &lt;li&gt;Test list item 4&lt;/li&gt;
&lt;/ul&gt;</pre>
<p>Now let&#8217;s imagine we need the first item in this list to have no border, but for all other items to have a 1px solid border on the left.  Our stylesheet would contain something like this:</p>
<pre>ul.horizontalList li {
    display:inline;
    padding:0 4px;
    border-left:1px solid #000;
}
ul.horizontalList li:first-child {
    border-left:0;
}</pre>
<p>Relatively simple, but in IE6 the second rule is ignored due to its lack of support for :first-child.  The common way to fix this is to add &#8220;class=&#8217;first&#8217;&#8221; to the first list item and then change the selector to:</p>
<pre>ul.horizontalList li.first</pre>
<p>This effectively makes the first-child pseudo class useless, as there is no point in applying the style to both.  And you may think &#8220;well sure, why not? It only takes a second to add.&#8221;  But all of these add up.  Let&#8217;s look at another example:</p>
<pre>&lt;div class="border highlight"&gt;
    &lt;p&gt;This is a test paragraph&lt;/p&gt;
&lt;/div&gt;

&lt;style type="text/css"&gt;
    div.border { border:1px solid #000; color:#000; }
    div.highlight { background:#F00; }
    div.border.highlight { color:#FFF; font-weight:bold; }
&lt;/style&gt;</pre>
<p>According to this, any div with class=&#8221;highlight&#8221; should have a red background and any div with class=&#8221;border&#8221; should have black text and a black border.  But if a div has both classes, the text should instead be white and bold.  Simple, yes?  Well IE6 ignores the last line, which can be a real pain in some cases.  Often it forces you to create a new class such as class=&#8221;borderHighlight&#8221; to encapsulate both styles, or to have parent elements with a different class to modify the appearance of their children.</p>
<p>My point is this: if you have to rewrite some of your CSS or markup to accomodate this kind of behaviour, don&#8217;t.  It&#8217;s simple &#8211; if I buy a computer game and it has a bug, the first thing I&#8217;m asked to do when I contact tech support is upgrade to the latest version.  Why?  Because the problem has already been addressed.  This should be your approach to web development &#8211; make the client aware that they have an out of date browser by displaying a message to only users or IE6 or below.  Recommend that they upgrade to the latest version of Internet Explorer and warn them that the site may display incorrectly if they do not.</p>
<h3>Be flexible</h3>
<p>This isn&#8217;t a hard and fast rule.  If a client is paying you to support IE6 then spend the extra time doing so.  And sometimes an extra line of css can make all the difference.  Don&#8217;t drop support for IE6 just to spite its users &#8211; use the fixes you can quickly apply but don&#8217;t let it impact on the markup and styles you use for other browsers.  Ultimately you have to decide whether the time you spend is worth the result.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluearena.com/2009/05/ie6-when-enough-is-enough/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

